2020
2121// MODULES //
2222
23- var path = require ( 'path' ) ;
23+ var join = require ( 'path' ) . join ;
2424var logger = require ( 'debug' ) ;
2525var mkdirp = require ( 'mkdirp' ) ;
26+ var dirname = require ( '@stdlib/utils/dirname' ) ;
2627var objectKeys = require ( '@stdlib/utils/keys' ) ;
2728var writeFile = require ( '@stdlib/fs/write-file' ) ;
2829
@@ -72,8 +73,8 @@ function write( src, dest, db, clbk ) {
7273 i += 1 ;
7374
7475 file = files [ i ] ;
75- dpath = path . dirname ( file . substring ( src . length + 1 ) ) ; // +1 to account for path separator
76- dpath = path . join ( dest , dpath ) ;
76+ dpath = dirname ( file . substring ( src . length + 1 ) ) ; // +1 to account for path separator
77+ dpath = join ( dest , dpath ) ;
7778
7879 debug ( 'Creating output directory: %s' , dpath ) ;
7980 mkdirp ( dpath , onDir ) ;
@@ -93,7 +94,7 @@ function write( src, dest, db, clbk ) {
9394 }
9495 debug ( 'Successfully created output directory.' ) ;
9596
96- fpath = path . join ( dpath , BASENAME ) ;
97+ fpath = join ( dpath , BASENAME ) ;
9798 debug ( 'Writing file %d of %d: %s' , i + 1 , total , fpath ) ;
9899
99100 writeFile ( fpath , db [ file ] , fopts , onWrite ) ;
0 commit comments