File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const downloadFolder = (URL: string, currentPath: string = '') => {
43
43
try {
44
44
mkdirSync ( 'out' )
45
45
} catch ( e ) {
46
+ logger . info ( `The directory out already exists` )
46
47
}
47
48
48
49
// Download le files.
@@ -52,19 +53,19 @@ const downloadFolder = (URL: string, currentPath: string = '') => {
52
53
if ( data [ i ] . type === 'directory' ) {
53
54
try {
54
55
// Create directory
55
- mkdirSync ( `out/${ currentPath } / ${ data [ i ] . name } ` )
56
- logger . info ( `created out/${ currentPath } / ${ data [ i ] . name } ` )
56
+ mkdirSync ( `out/${ currentPath } ${ data [ i ] . name } ` )
57
+ logger . info ( `created out/${ currentPath } ${ data [ i ] . name } ` )
57
58
} catch ( e ) {
58
59
// Error incase directory exists
59
- logger . error ( `Directory out/${ currentPath } / ${ data [ i ] . name } exists already` )
60
+ logger . error ( `Directory out/${ currentPath } ${ data [ i ] . name } exists already` )
60
61
}
61
62
// Download the file
62
63
downloadFolder ( `${ URL } ${ data [ i ] . name } /` , currentPath + data [ i ] . name + '/' )
63
64
logger . info ( `Downloaded ${ currentPath + data [ i ] . name + '/' } ` )
64
65
} else {
65
66
// Just download if in root directory
66
- Download ( `${ URL } ${ data [ i ] . name } ` ) . pipe ( createWriteStream ( `out/${ currentPath + '/' + data [ i ] . name } ` ) )
67
- logger . info ( `Downloaded ${ data [ i ] . name } ` )
67
+ Download ( `${ URL } ${ data [ i ] . name } ` ) . pipe ( createWriteStream ( `out/${ currentPath + data [ i ] . name } ` ) )
68
+ logger . info ( `Downloaded out/ ${ currentPath + data [ i ] . name } ` )
68
69
}
69
70
}
70
71
} )
You can’t perform that action at this time.
0 commit comments