redzip 4.3.0 → 4.4.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 +5 -0
- package/lib/local/index.js +5 -4
- package/package.json +1 -1
package/ChangeLog
CHANGED
package/lib/local/index.js
CHANGED
|
@@ -41,18 +41,21 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
41
41
|
date,
|
|
42
42
|
} = options;
|
|
43
43
|
|
|
44
|
+
const dirPath = dirname(outerPath);
|
|
45
|
+
const {date: dirDate} = await readStat(dirPath);
|
|
46
|
+
|
|
44
47
|
if (!readStream) {
|
|
45
48
|
await mkdir(outerPath, {
|
|
46
49
|
recursive: true,
|
|
47
50
|
mode,
|
|
48
51
|
});
|
|
52
|
+
|
|
49
53
|
await maybeSetDate(outerPath, date);
|
|
54
|
+
await maybeSetDate(dirPath, dirDate);
|
|
50
55
|
|
|
51
56
|
return;
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
const dirPath = dirname(outerPath);
|
|
55
|
-
|
|
56
59
|
await mkdir(dirPath, {
|
|
57
60
|
recursive: true,
|
|
58
61
|
});
|
|
@@ -64,8 +67,6 @@ export const write = async (outerPath, innerPath, readStream, options = {}) => {
|
|
|
64
67
|
if (unzip)
|
|
65
68
|
return await pipe([readStream, createGunzip(), writeStream]);
|
|
66
69
|
|
|
67
|
-
const {date: dirDate} = await readStat(dirPath);
|
|
68
|
-
|
|
69
70
|
await pipe([readStream, writeStream]);
|
|
70
71
|
|
|
71
72
|
await maybeSetDate(outerPath, date);
|