@yao-pkg/pkg 6.10.0 → 6.10.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg",
3
- "version": "6.10.0",
3
+ "version": "6.10.1",
4
4
  "description": "Package your Node.js project into an executable",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -185,9 +185,7 @@ function copyFolderRecursiveSync(source, target) {
185
185
  const targetFolder = path.join(target, path.basename(source));
186
186
 
187
187
  // Check if target folder needs to be created or integrated
188
- if (!fs.existsSync(targetFolder)) {
189
- fs.mkdirSync(targetFolder);
190
- }
188
+ fs.mkdirSync(targetFolder, { recursive: true });
191
189
 
192
190
  // Copy
193
191
  if (fs.lstatSync(source).isDirectory()) {
@@ -249,13 +247,6 @@ function copyFolderRecursiveSync(source, target) {
249
247
  }
250
248
  }
251
249
 
252
- function createDirRecursively(dir) {
253
- if (!fs.existsSync(dir)) {
254
- createDirRecursively(path.join(dir, '..'));
255
- fs.mkdirSync(dir);
256
- }
257
- }
258
-
259
250
  /*
260
251
 
261
252
  // TODO move to some test
@@ -2218,7 +2209,7 @@ function payloadFileSync(pointer) {
2218
2209
  // Example: /home/john/.cache/pkg/<hash>
2219
2210
  const tmpFolder = path.join(homedir(), '.cache/pkg', hash);
2220
2211
 
2221
- createDirRecursively(tmpFolder);
2212
+ fs.mkdirSync(tmpFolder, { recursive: true });
2222
2213
 
2223
2214
  // Example: moduleFolder = /snapshot/appname/node_modules/sharp/build/Release
2224
2215
  const parts = moduleFolder.split(path.sep);