@@ -6,9 +6,11 @@ import * as glob from "glob";
66 * @param folderPath Folder path
77 */
88export function deleteAll ( folderPath : string ) {
9- const files : string [ ] = glob . sync ( folderPath + "/**/*" , { dot : true , nodir : true } ) ;
9+ const files : string [ ] = glob . sync ( folderPath + "/**/*" , { dot : true , nodir : true } )
10+ . map ( filePath => filePath . replace ( / \\ / g, "/" ) ) ;
1011 files . forEach ( x => fs . unlinkSync ( x ) ) ;
11- const folders : string [ ] = glob . sync ( folderPath + "/**/*" , { dot : true } ) ;
12+ const folders : string [ ] = glob . sync ( folderPath + "/**/*" , { dot : true } )
13+ . map ( filePath => filePath . replace ( / \\ / g, "/" ) ) ;
1214 folders . reverse ( ) . forEach ( x => fs . rmdirSync ( x ) ) ;
1315}
1416
@@ -25,8 +27,10 @@ export function filesDiff(
2527 transform1 ?: ( val : string ) => string ,
2628 transform2 ?: ( val : string ) => string
2729) : string [ ] {
28- let files1 : string [ ] = glob . sync ( "**/*" , { cwd : folderPath1 , dot : true , nodir : true } ) ;
29- let files2 : string [ ] = glob . sync ( "**/*" , { cwd : folderPath1 , dot : true , nodir : true } ) ;
30+ let files1 : string [ ] = glob . sync ( "**/*" , { cwd : folderPath1 , dot : true , nodir : true } )
31+ . map ( filePath => filePath . replace ( / \\ / g, "/" ) ) ;
32+ let files2 : string [ ] = glob . sync ( "**/*" , { cwd : folderPath1 , dot : true , nodir : true } )
33+ . map ( filePath => filePath . replace ( / \\ / g, "/" ) ) ;
3034 if ( transform1 ) {
3135 files1 = files1 . map ( transform1 ) ;
3236 }
0 commit comments