nw-builder 4.3.8 → 4.3.9

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/get.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nw-builder",
3
- "version": "4.3.8",
3
+ "version": "4.3.9",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
package/src/get.js CHANGED
@@ -10,6 +10,7 @@ import compressing from "compressing";
10
10
  import { log } from "./log.js";
11
11
  import { PLATFORM_KV, ARCH_KV } from "./util.js";
12
12
  import { replaceFfmpeg } from "./util/ffmpeg.js";
13
+ import child_process from "child_process";
13
14
 
14
15
  /**
15
16
  * _Note: This an internal function which is not called directly. Please see example usage below._
@@ -162,6 +163,22 @@ export async function get({
162
163
  compressing.tgz
163
164
  .uncompress(out, ffmpeg ? nwDir : cacheDir)
164
165
  .then(() => resolve());
166
+ } else if (platform === "osx") {
167
+ //TODO: compressing package does not restore symlinks on some macOS (eg: circleCI)
168
+ const exec = function (cmd) {
169
+ log.debug(cmd);
170
+ const result = child_process.spawnSync(cmd, {
171
+ shell: true,
172
+ stdio: "inherit",
173
+ });
174
+ if (result.status !== 0) {
175
+ log.debug(`Command failed with status ${result.status}`);
176
+ if (result.error) console.log(result.error);
177
+ process.exit(1);
178
+ }
179
+ return resolve();
180
+ };
181
+ exec(`unzip -o "${out}" -d "${ffmpeg ? nwDir : cacheDir}"`);
165
182
  } else {
166
183
  compressing.zip
167
184
  .uncompress(out, ffmpeg ? nwDir : cacheDir)