ppcos 1.0.4 → 1.0.5
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/lib/utils/fs-helpers.js +6 -2
- package/package.json +1 -1
package/lib/utils/fs-helpers.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* File system helper utilities
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { readdir, stat, mkdir, copyFile, access } from 'node:fs/promises';
|
|
6
|
-
import { readdirSync, statSync, mkdirSync, copyFileSync, existsSync } from 'node:fs';
|
|
5
|
+
import { readdir, stat, mkdir, copyFile, access, chmod } from 'node:fs/promises';
|
|
6
|
+
import { readdirSync, statSync, mkdirSync, copyFileSync, existsSync, chmodSync } from 'node:fs';
|
|
7
7
|
import { join, relative, dirname } from 'node:path';
|
|
8
8
|
import { constants } from 'node:fs';
|
|
9
9
|
|
|
@@ -83,6 +83,8 @@ export async function copyFileWithDirs(src, dest) {
|
|
|
83
83
|
const destDir = dirname(dest);
|
|
84
84
|
await mkdir(destDir, { recursive: true });
|
|
85
85
|
await copyFile(src, dest);
|
|
86
|
+
const srcStats = await stat(src);
|
|
87
|
+
await chmod(dest, srcStats.mode);
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -96,6 +98,8 @@ export function copyFileWithDirsSync(src, dest) {
|
|
|
96
98
|
mkdirSync(destDir, { recursive: true });
|
|
97
99
|
}
|
|
98
100
|
copyFileSync(src, dest);
|
|
101
|
+
const srcStats = statSync(src);
|
|
102
|
+
chmodSync(dest, srcStats.mode);
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
/**
|