Skip to content

Commit

Permalink
Change instances of 'deleteAsync' to 'removeAsync' because of node-fs…
Browse files Browse the repository at this point in the history
…-extra update jprichardson/node-fs-extra#171

Change comments about deleting to removing to keep a common terminology in the code
  • Loading branch information
motiazu committed Dec 13, 2015
1 parent 8d5771f commit 21057e5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ var remove = function( options, src, dst ) {
var fullSrc = path.join( src, leaf );
var fullDst = path.join( dst, leaf );
if ( !fs.existsSync( fullSrc ) ) {
// exists in dst but not src - delete it
fs.deleteSync( fullDst );
// exists in dst but not src - remove it
fs.removeSync( fullDst );
removed++;
} else {
var statSrc = fs.statSync( fullSrc );
var statDst = fs.statSync( fullDst );
if ( statSrc.isFile() !== statDst.isFile() || statSrc.isDirectory() !== statDst.isDirectory() ) {
fs.deleteSync( fullDst ); // make sure they are the same type, else delete it
fs.removeSync( fullDst ); // make sure they are the same type, else remove it
} else if ( statDst.isDirectory() ) {
remove( options, fullSrc, fullDst );
}
Expand All @@ -82,8 +82,8 @@ var create = function( options, src, dst ) {
if ( existsDst ) {
var statDst = fs.statSync( fullDst );
if ( statDst.isDirectory() ) {
// directory exists with same name as the file - delete it and copy
fs.deleteSync( fullDst );
// directory exists with same name as the file - remove it and copy
fs.removeSync( fullDst );
fs.copySync( fullSrc, fullDst, { force: true } );
updated++;
} else if ( statDst.isFile() ) {
Expand Down Expand Up @@ -129,7 +129,7 @@ var dirSync = function(src, dst, options) {

var printSummaryType = typeof options.printSummary;
if ( printSummaryType === 'boolean' && options.printSummary === true ) {
gutil.log( 'Dir Sync: ' + created + ' files created, ' + updated + ' files updated, ' + removed + ' items deleted, ' + same + ' files unchanged' );
gutil.log( 'Dir Sync: ' + created + ' files created, ' + updated + ' files updated, ' + removed + ' items removed, ' + same + ' files unchanged' );
} else if ( printSummaryType === 'function' ) {
options.printSummary( { created: created, removed: removed, updated: updated, same: same } );
}
Expand Down

0 comments on commit 21057e5

Please sign in to comment.