redzip 4.1.0 → 4.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 +7 -1
- package/lib/local/index.js +14 -3
- package/lib/zip/write/index.js +3 -1
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
2026.02.24, v4.2.0
|
|
2
|
+
|
|
3
|
+
feature:
|
|
4
|
+
- 2c7e9cc redzip: write: date: directory (coderaiser/cloudcmd#457)
|
|
5
|
+
- de68a82 redzip: write: date: add (coderaiser/cloudcmd#457)
|
|
6
|
+
|
|
1
7
|
2026.02.21, v4.1.0
|
|
2
8
|
|
|
3
9
|
feature:
|
|
4
|
-
- 7ccfd80 redzip: write: date: add (
|
|
10
|
+
- 7ccfd80 redzip: write: date: add (coderaiser/cloudcmd/#457)
|
|
5
11
|
- 72df84a redzip: redlint v6.1.1
|
|
6
12
|
- 5751676 redzip: putout v42.0.12
|
|
7
13
|
- 25589de redzip: madrun v13.0.0
|
package/lib/local/index.js
CHANGED
|
@@ -27,6 +27,13 @@ const winNotDir = (e) => e?.code === 'ENOENT';
|
|
|
27
27
|
|
|
28
28
|
const {assign} = Object;
|
|
29
29
|
|
|
30
|
+
const maybeSetDate = async (path, date) => {
|
|
31
|
+
if (!date)
|
|
32
|
+
return;
|
|
33
|
+
|
|
34
|
+
await tryToCatch(utimes, path, date, date);
|
|
35
|
+
};
|
|
36
|
+
|
|
30
37
|
export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
31
38
|
const {
|
|
32
39
|
unzip,
|
|
@@ -39,10 +46,14 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
39
46
|
recursive: true,
|
|
40
47
|
mode,
|
|
41
48
|
});
|
|
49
|
+
await maybeSetDate(outerPath, date);
|
|
50
|
+
|
|
42
51
|
return;
|
|
43
52
|
}
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
const dirPath = dirname(outerPath);
|
|
55
|
+
|
|
56
|
+
await mkdir(dirPath, {
|
|
46
57
|
recursive: true,
|
|
47
58
|
});
|
|
48
59
|
|
|
@@ -55,8 +66,8 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
55
66
|
|
|
56
67
|
await pipe([readStream, writeStream]);
|
|
57
68
|
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
await maybeSetDate(outerPath, date);
|
|
70
|
+
await maybeSetDate(dirPath, date);
|
|
60
71
|
};
|
|
61
72
|
|
|
62
73
|
export const readSize = async (outerPath, innerPath, options) => {
|
package/lib/zip/write/index.js
CHANGED
|
@@ -74,7 +74,9 @@ async function update(outerPath, innerPath, stream, zipfile, {remove, date}) {
|
|
|
74
74
|
zipfile.addReadStream(stream, shortPath);
|
|
75
75
|
|
|
76
76
|
if (!remove && !stream)
|
|
77
|
-
zipfile.addEmptyDirectory(shortPath
|
|
77
|
+
zipfile.addEmptyDirectory(shortPath, {
|
|
78
|
+
mtime: date,
|
|
79
|
+
});
|
|
78
80
|
|
|
79
81
|
let count = 0;
|
|
80
82
|
|