@vanillaes/esmtk 0.15.0 → 0.15.1
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/.vscode/launch.json +12 -0
- package/bin/commands/cp.js +6 -1
- package/package.json +1 -1
package/.vscode/launch.json
CHANGED
|
@@ -108,6 +108,18 @@
|
|
|
108
108
|
"cwd": "${workspaceFolder}",
|
|
109
109
|
"args": ["cp", "./test/cp/test1.txt", "./test/cp2/test1.txt"],
|
|
110
110
|
"console": "integratedTerminal",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "CopyGlobToFolder",
|
|
114
|
+
"type": "node",
|
|
115
|
+
"request": "launch",
|
|
116
|
+
"skipFiles": [
|
|
117
|
+
"<node_internals>/**"
|
|
118
|
+
],
|
|
119
|
+
"program": "${workspaceFolder}/bin/esmtk.js",
|
|
120
|
+
"cwd": "${workspaceFolder}",
|
|
121
|
+
"args": ["cp", "./test/cp/*.js", "./test/cp2/"],
|
|
122
|
+
"console": "integratedTerminal",
|
|
111
123
|
},
|
|
112
124
|
{
|
|
113
125
|
"name": "CopyFileToFile - Error source doesn't exist",
|
package/bin/commands/cp.js
CHANGED
|
@@ -16,13 +16,18 @@ export async function cp (paths, options) {
|
|
|
16
16
|
const source = paths[0]
|
|
17
17
|
const target = paths[1]
|
|
18
18
|
|
|
19
|
-
if (!options?.recursive) {
|
|
19
|
+
if (!options?.recursive && !source.includes('*')) {
|
|
20
20
|
await copyAsync(source, target, options?.force)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (options?.recursive) {
|
|
24
24
|
await copyRecursiveAsync(source, target, options?.force)
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
if (source.includes('*')) {
|
|
28
|
+
const sources = await expandSource(source)
|
|
29
|
+
await copyMultipleAsync(sources, target)
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
if (paths.length >= 2) {
|