Copy file into directory (#11)

* Copy file into directory

* Add test and check if file exists before stating

* Format
This commit is contained in:
Danny McCormick
2019-05-28 13:57:16 -04:00
committed by GitHub
parent 08db5110c6
commit 8ebbf59cb3
2 changed files with 21 additions and 0 deletions

View File

@@ -267,6 +267,9 @@ async function move(
await copyDirectoryContents(source, dest, force, moveOptions.deleteOriginal)
} else {
if ((await ioUtil.exists(dest)) && (await ioUtil.isDirectory(dest))) {
dest = path.join(dest, path.basename(source))
}
if (force) {
await ioUtil.copyFile(source, dest)
} else {