@@ -10,7 +10,7 @@ public class ResetFilesService
1010 {
1111 public AppConfig Config { get ; set ; }
1212
13- public override object OnGet ( ResetFiles request )
13+ public override object OnPost ( ResetFiles request )
1414 {
1515 var rootDir = Config . RootDirectory ;
1616
@@ -23,30 +23,29 @@ public override object OnGet(ResetFiles request)
2323
2424 foreach ( var filePath in Directory . GetFiles ( "~/" . MapHostAbsolutePath ( ) ) )
2525 {
26- if ( filePath . EndsWith ( ".cs" ) || filePath . EndsWith ( ".htm" ) )
27- {
28- File . Copy ( filePath , Path . Combine ( rootDir , Path . GetFileName ( filePath ) ) ) ;
29- }
26+ if ( ! filePath . EndsWith ( ".cs" ) && ! filePath . EndsWith ( ".htm" ) ) continue ;
27+
28+ var fileName = Path . GetFileName ( filePath ) ;
29+ if ( filePath . EndsWith ( ".cs" ) ) fileName += ".txt" ;
30+ File . Copy ( filePath , Path . Combine ( rootDir , fileName ) ) ;
3031 }
3132
3233 var servicesDir = Path . Combine ( rootDir , "services" ) ;
3334 Directory . CreateDirectory ( servicesDir ) ;
3435 foreach ( var filePath in Directory . GetFiles ( "~/../RestFiles.ServiceInterface/" . MapHostAbsolutePath ( ) ) )
3536 {
36- if ( filePath . EndsWith ( "Service.cs" ) )
37- {
38- File . Copy ( filePath , Path . Combine ( servicesDir , Path . GetFileName ( filePath ) ) ) ;
39- }
37+ if ( ! filePath . EndsWith ( "Service.cs" ) ) continue ;
38+
39+ File . Copy ( filePath , Path . Combine ( servicesDir , Path . GetFileName ( filePath ) + ".txt" ) ) ;
4040 }
4141
4242 var testsDir = Path . Combine ( rootDir , "tests" ) ;
4343 Directory . CreateDirectory ( testsDir ) ;
4444 foreach ( var filePath in Directory . GetFiles ( "~/../RestFiles.Tests/" . MapHostAbsolutePath ( ) ) )
4545 {
46- if ( filePath . EndsWith ( ".cs" ) )
47- {
48- File . Copy ( filePath , Path . Combine ( testsDir , Path . GetFileName ( filePath ) ) ) ;
49- }
46+ if ( ! filePath . EndsWith ( ".cs" ) ) continue ;
47+
48+ File . Copy ( filePath , Path . Combine ( testsDir , Path . GetFileName ( filePath ) + ".txt" ) ) ;
5049 }
5150
5251 var dtosDir = Path . Combine ( rootDir , "dtos" ) ;
@@ -55,13 +54,13 @@ public override object OnGet(ResetFiles request)
5554 Directory . CreateDirectory ( opsDtoPath ) ;
5655 foreach ( var filePath in Directory . GetFiles ( "~/../RestFiles.ServiceModel/Operations/" . MapHostAbsolutePath ( ) ) )
5756 {
58- File . Copy ( filePath , Path . Combine ( opsDtoPath , Path . GetFileName ( filePath ) ) ) ;
57+ File . Copy ( filePath , Path . Combine ( opsDtoPath , Path . GetFileName ( filePath ) + ".txt" ) ) ;
5958 }
6059 var typesDtoPath = Path . Combine ( dtosDir , "Types" ) ;
6160 Directory . CreateDirectory ( typesDtoPath ) ;
6261 foreach ( var filePath in Directory . GetFiles ( "~/../RestFiles.ServiceModel/Types/" . MapHostAbsolutePath ( ) ) )
6362 {
64- File . Copy ( filePath , Path . Combine ( typesDtoPath , Path . GetFileName ( filePath ) ) ) ;
63+ File . Copy ( filePath , Path . Combine ( typesDtoPath , Path . GetFileName ( filePath ) + ".txt" ) ) ;
6564 }
6665
6766 return new ResetFilesResponse ( ) ;
0 commit comments