Commit 64b81e3 liuyt
committed
1 parent 3113b2b commit 64b81e3 Copy full SHA for 64b81e3
File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,18 @@ let mkdirSync = function (dirpath, mode) {
14
14
if ( ! fs . existsSync ( dirpath ) ) {
15
15
let pathtmp ;
16
16
dirpath . split ( / [ / \\ ] / ) . forEach ( function ( dirname ) {
17
+ if ( dirname === '' ) {
18
+ if ( ! pathtmp ) {
19
+ pathtmp += '/' ;
20
+ }
21
+ return false ;
22
+ }
17
23
if ( pathtmp ) {
18
24
pathtmp = path . join ( pathtmp , dirname ) ;
19
25
} else {
20
26
pathtmp = dirname ;
21
27
}
28
+
22
29
if ( ! fs . existsSync ( pathtmp ) ) {
23
30
if ( ! fs . mkdirSync ( pathtmp , mode ) ) {
24
31
return false ;
@@ -28,7 +35,7 @@ let mkdirSync = function (dirpath, mode) {
28
35
}
29
36
return true ;
30
37
} catch ( e ) {
31
- log . error ( "create director fail! path=" + dirpath + " errorMsg:" + e ) ;
38
+ console . error ( "create director fail! path=" + dirpath + " errorMsg:" + e ) ;
32
39
return false ;
33
40
}
34
41
}
You can’t perform that action at this time.
0 commit comments