nw-builder 4.3.11 → 4.4.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": "nw-builder",
3
- "version": "4.3.11",
3
+ "version": "4.4.1",
4
4
  "description": "Build NW.js desktop applications for MacOS, Windows and Linux.",
5
5
  "keywords": [
6
6
  "NW.js",
package/src/get_ffmpeg.js CHANGED
@@ -63,9 +63,35 @@ export async function get_ffmpeg({
63
63
  });
64
64
  }
65
65
 
66
+ const unzipFFMPeg = async () => {
67
+ if (platform === "linux") {
68
+ await compressing.tgz.uncompress(out, nwDir);
69
+ } else {
70
+ await compressing.zip.uncompress(out, nwDir);
71
+ }
72
+ let ffmpegFile;
73
+ if (platform === "linux") {
74
+ ffmpegFile = "libffmpeg.so";
75
+ } else if (platform === "win") {
76
+ ffmpegFile = "ffmpeg.dll";
77
+ } else if (platform === "osx") {
78
+ ffmpegFile = "libffmpeg.dylib";
79
+ }
80
+ await replaceFfmpeg(platform, nwDir, ffmpegFile);
81
+
82
+ if (cache === false) {
83
+ log.debug(`Removing FFMPEG zip cache`);
84
+ await rm(out, {
85
+ recursive: true,
86
+ force: true,
87
+ });
88
+ log.debug(`FFMPEG zip cache removed`);
89
+ }
90
+ };
66
91
  // Check if cache exists.
67
92
  if (existsSync(out)) {
68
93
  log.debug(`Found existing FFMPEG cache`);
94
+ await unzipFFMPeg();
69
95
  return;
70
96
  }
71
97
 
@@ -94,11 +120,7 @@ export async function get_ffmpeg({
94
120
  response.on("end", () => {
95
121
  log.debug(`FFMPEG fully downloaded`);
96
122
  bar.stop();
97
- if (platform === "linux") {
98
- compressing.tgz.uncompress(out, nwDir).then(() => resolve());
99
- } else {
100
- compressing.zip.uncompress(out, nwDir).then(() => resolve());
101
- }
123
+ resolve();
102
124
  });
103
125
 
104
126
  response.pipe(stream);
@@ -111,24 +133,5 @@ export async function get_ffmpeg({
111
133
  });
112
134
 
113
135
  // Remove compressed file after download and decompress.
114
- return request.then(async () => {
115
- let ffmpegFile;
116
- if (platform === "linux") {
117
- ffmpegFile = "libffmpeg.so";
118
- } else if (platform === "win") {
119
- ffmpegFile = "ffmpeg.dll";
120
- } else if (platform === "osx") {
121
- ffmpegFile = "libffmpeg.dylib";
122
- }
123
- await replaceFfmpeg(platform, nwDir, ffmpegFile);
124
-
125
- if (cache === false) {
126
- log.debug(`Removing FFMPEG zip cache`);
127
- await rm(out, {
128
- recursive: true,
129
- force: true,
130
- });
131
- log.debug(`FFMPEG zip cache removed`);
132
- }
133
- });
136
+ return request.then(unzipFFMPeg);
134
137
  }
package/src/index.js CHANGED
@@ -93,10 +93,13 @@ const nwbuild = async (options) => {
93
93
  options.version = releaseInfo.version.slice(1);
94
94
 
95
95
  if (options.logLevel === "debug") {
96
- log.debug(`Platform: ${platform}`);
97
- log.debug(`Archicture: ${arch}`);
96
+ log.debug(`System Platform: ${platform}`);
97
+ log.debug(`System Architecture: ${arch}`);
98
98
  log.debug(`Node Version: ${version}`);
99
- log.debug(`NW.js Version: ${options.version}\n`);
99
+ log.debug(`Build NW.js Version: ${options.version}`);
100
+ log.debug(`Build Flavor: ${options.flavor}`);
101
+ log.debug(`Build Platform: ${options.platform}`);
102
+ log.debug(`Build Architecture: ${options.arch}`);
100
103
  }
101
104
 
102
105
  nwDir = resolve(
package/src/run.js CHANGED
@@ -54,7 +54,7 @@ export async function run({
54
54
  // It is assumed that the package.json is located at srcDir/package.json
55
55
  const nwProcess = spawn(
56
56
  resolve(nwDir, EXE_NAME[platform]),
57
- [srcDir.concat(argv)],
57
+ [...[srcDir], ...argv],
58
58
  {
59
59
  detached: true,
60
60
  windowsHide: true,