File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ await catalogResponse.Content.ReadAsStringAsync(),
199
199
}
200
200
201
201
var fileContent = await fileContentResponse . Content . ReadAsStringAsync ( ) ;
202
+ MakeSureFolderExists ( filePath ) ;
202
203
File . WriteAllText ( filePath , fileContent ) ;
203
204
}
204
205
}
@@ -253,6 +254,17 @@ string HomePageHtml(
253
254
</html>
254
255
""" ;
255
256
257
+ void MakeSureFolderExists ( string path )
258
+ {
259
+ var directory = Path . GetDirectoryName ( path ) ;
260
+ if ( directory is null ) return ;
261
+
262
+ var directoryInfo = new DirectoryInfo ( Path . GetFullPath ( directory ) ) ;
263
+
264
+ if ( ! directoryInfo . Exists )
265
+ directoryInfo . Create ( ) ;
266
+ }
267
+
256
268
partial class Program
257
269
{
258
270
[ GeneratedRegex ( @"([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)|(\[[0-9A-Fa-f:.]+\])|([a-zA-Z0-9.-]+)(:\d+)?" ) ]
You can’t perform that action at this time.
0 commit comments