nw-builder 4.3.7 → 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.
- package/package.json +3 -3
- package/src/get.js +17 -0
- package/src/util/ffmpeg.js +17 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nw-builder",
|
|
3
|
-
"version": "4.3.
|
|
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",
|
|
@@ -55,10 +55,10 @@
|
|
|
55
55
|
"concurrently": "^8.2.0",
|
|
56
56
|
"eslint": "^8.45.0",
|
|
57
57
|
"eslint-config-tjw-jsdoc": "^1.0.3",
|
|
58
|
-
"gh-pages": "^
|
|
58
|
+
"gh-pages": "^6.0.0",
|
|
59
59
|
"jsdoc": "^4.0.2",
|
|
60
60
|
"jsdoc-to-markdown": "^8.0.0",
|
|
61
|
-
"prettier": "^3.0.
|
|
61
|
+
"prettier": "^3.0.1",
|
|
62
62
|
"selenium-webdriver": "^4.10.0",
|
|
63
63
|
"vitepress": "^1.0.0-beta.5"
|
|
64
64
|
},
|
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)
|
package/src/util/ffmpeg.js
CHANGED
|
@@ -17,7 +17,7 @@ export const replaceFfmpeg = async (platform, nwDir, ffmpegFile) => {
|
|
|
17
17
|
// don't do anything for windows because the extracted file is already in the correct path
|
|
18
18
|
// await copyFile(src, resolve(nwDir, ffmpegFile));
|
|
19
19
|
} else if (platform === "osx") {
|
|
20
|
-
|
|
20
|
+
let dest = resolve(
|
|
21
21
|
nwDir,
|
|
22
22
|
"nwjs.app",
|
|
23
23
|
"Contents",
|
|
@@ -28,6 +28,21 @@ export const replaceFfmpeg = async (platform, nwDir, ffmpegFile) => {
|
|
|
28
28
|
ffmpegFile,
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
try {
|
|
32
|
+
await copyFile(src, dest);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
//some versions of node/macOS complain about destination being a file, and others complain when it is only a directory.
|
|
35
|
+
//the only thing I can think to do is to try both
|
|
36
|
+
dest = resolve(
|
|
37
|
+
nwDir,
|
|
38
|
+
"nwjs.app",
|
|
39
|
+
"Contents",
|
|
40
|
+
"Frameworks",
|
|
41
|
+
"nwjs Framework.framework",
|
|
42
|
+
"Versions",
|
|
43
|
+
"Current",
|
|
44
|
+
);
|
|
45
|
+
await copyFile(src, dest);
|
|
46
|
+
}
|
|
32
47
|
}
|
|
33
48
|
};
|