Last active
August 29, 2015 14:01
-
-
Save asakusuma/dde3cc6762059b98a257 to your computer and use it in GitHub Desktop.
_copyFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mover.prototype._copyFile = function (directory, source, destination, leaveOriginal) { | |
if(source === './') { | |
var src = path.join(directory, source), | |
entries = fs.readdirSync(src).sort(), | |
mkdir = true; | |
for (var i = 0; i < entries.length; i++) { | |
helpers.copyRecursivelySync( | |
src + entries[i], | |
path.join(directory, destination) + '/' + entries[i], mkdir); | |
mkdir = false; | |
} | |
} else { | |
helpers.copyRecursivelySync( | |
path.join(directory, source), | |
path.join(directory, destination)); | |
} | |
if (!leaveOriginal) { rimraf.sync(path.join(directory, source)); } | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment