@vanillaes/esmtk 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cp.js +4 -4
package/package.json
CHANGED
package/src/cp.js
CHANGED
|
@@ -41,8 +41,8 @@ export async function copyAsync (source, target, force = false) {
|
|
|
41
41
|
|
|
42
42
|
// append source file name to target directory
|
|
43
43
|
const sourceFile = basename(source)
|
|
44
|
-
target = target.endsWith(
|
|
45
|
-
target = `${target}
|
|
44
|
+
target = target.endsWith(sep) ? target.slice(0, -1) : target
|
|
45
|
+
target = `${target}${sep}${sourceFile}`
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
try {
|
|
@@ -72,9 +72,9 @@ export async function copyMultipleAsync (sources, target, force = false) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
try {
|
|
75
|
-
target = target.endsWith(
|
|
75
|
+
target = target.endsWith(sep) ? target.slice(0, -1) : target
|
|
76
76
|
for (const source of sources) {
|
|
77
|
-
await cp(source, `${target}
|
|
77
|
+
await cp(source, `${target}${sep}${basename(source)}`, { force: true })
|
|
78
78
|
}
|
|
79
79
|
} catch (err) {
|
|
80
80
|
console.error(`cp": error ${err.message}`)
|