copymitter 10.0.2 → 10.2.0
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/ChangeLog +15 -0
- package/bun.lock +1836 -0
- package/lib/copymitter.js +14 -6
- package/package.json +6 -6
package/lib/copymitter.js
CHANGED
|
@@ -128,10 +128,11 @@ Copymitter.prototype._cpAll = function() {
|
|
|
128
128
|
|
|
129
129
|
const copyDir = async (from, to, overrides = {}) => {
|
|
130
130
|
const {write} = overrides;
|
|
131
|
-
const {mode} = await readStat(from);
|
|
131
|
+
const {mode, date} = await readStat(from);
|
|
132
132
|
|
|
133
133
|
await write(to, null, {
|
|
134
134
|
mode,
|
|
135
|
+
date,
|
|
135
136
|
});
|
|
136
137
|
};
|
|
137
138
|
|
|
@@ -211,8 +212,12 @@ async function copy(from, to, {emitError, emitFile, emitDirectory, countStream,
|
|
|
211
212
|
return emitDirectory();
|
|
212
213
|
}
|
|
213
214
|
|
|
215
|
+
const {date, mode} = info;
|
|
216
|
+
|
|
214
217
|
const [error] = await tryToCatch(superCopy, from, to, [countStream], {
|
|
215
218
|
write,
|
|
219
|
+
date,
|
|
220
|
+
mode,
|
|
216
221
|
});
|
|
217
222
|
|
|
218
223
|
if (error)
|
|
@@ -222,7 +227,12 @@ async function copy(from, to, {emitError, emitFile, emitDirectory, countStream,
|
|
|
222
227
|
}
|
|
223
228
|
|
|
224
229
|
async function superCopy(from, to, [countStream], overrides) {
|
|
225
|
-
const {
|
|
230
|
+
const {
|
|
231
|
+
write,
|
|
232
|
+
date,
|
|
233
|
+
mode,
|
|
234
|
+
} = overrides;
|
|
235
|
+
|
|
226
236
|
const [, link] = await tryToCatch(readlink, from);
|
|
227
237
|
|
|
228
238
|
if (link) {
|
|
@@ -230,13 +240,11 @@ async function superCopy(from, to, [countStream], overrides) {
|
|
|
230
240
|
return;
|
|
231
241
|
}
|
|
232
242
|
|
|
233
|
-
const
|
|
234
|
-
read(from),
|
|
235
|
-
readStat(from),
|
|
236
|
-
]);
|
|
243
|
+
const readStream = await read(from);
|
|
237
244
|
|
|
238
245
|
await write(to, readStream.pipe(countStream), {
|
|
239
246
|
mode,
|
|
247
|
+
date,
|
|
240
248
|
});
|
|
241
249
|
}
|
|
242
250
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copymitter",
|
|
3
|
-
"version": "10.0
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "copy files with emitter",
|
|
6
6
|
"main": "lib/copymitter.js",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@iocmd/wait": "^2.1.0",
|
|
32
|
-
"c8": "^
|
|
32
|
+
"c8": "^11.0.0",
|
|
33
33
|
"eslint": "^10.0.0",
|
|
34
|
-
"eslint-plugin-putout": "^
|
|
35
|
-
"madrun": "^
|
|
34
|
+
"eslint-plugin-putout": "^31.0.1",
|
|
35
|
+
"madrun": "^13.0.0",
|
|
36
36
|
"nodemon": "^3.1.0",
|
|
37
37
|
"pullout": "^5.0.1",
|
|
38
|
-
"putout": "^
|
|
39
|
-
"redlint": "^
|
|
38
|
+
"putout": "^42.0.12",
|
|
39
|
+
"redlint": "^6.1.1",
|
|
40
40
|
"rimraf": "^6.1.2",
|
|
41
41
|
"supertape": "^12.5.0",
|
|
42
42
|
"try-catch": "^4.0.9"
|