nw-builder 4.3.6 → 4.3.7

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.6",
3
+ "version": "4.3.7",
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
@@ -181,7 +181,15 @@ export async function get({
181
181
  // Remove compressed file after download and decompress.
182
182
  return request.then(async () => {
183
183
  if (ffmpeg === true) {
184
- await replaceFfmpeg(platform, nwDir, out);
184
+ let ffmpegFile;
185
+ if (platform === "linux") {
186
+ ffmpegFile = "libffmpeg.so";
187
+ } else if (platform === "win") {
188
+ ffmpegFile = "ffmpeg.dll";
189
+ } else if (platform === "osx") {
190
+ ffmpegFile = "libffmpeg.dylib";
191
+ }
192
+ await replaceFfmpeg(platform, nwDir, ffmpegFile);
185
193
  }
186
194
 
187
195
  log.debug(`Binary decompressed starting removal`);
@@ -9,22 +9,25 @@ import { resolve } from "node:path";
9
9
  * @param {string} ffmpegFile The path to the ffmpeg file to replace with
10
10
  */
11
11
  export const replaceFfmpeg = async (platform, nwDir, ffmpegFile) => {
12
+ const src = resolve(nwDir, ffmpegFile);
12
13
  if (platform === "linux") {
13
- await copyFile(ffmpegFile, resolve(nwDir, "lib", ffmpegFile));
14
+ const dest = resolve(nwDir, "lib", ffmpegFile);
15
+ await copyFile(src, dest);
14
16
  } else if (platform === "win") {
15
- await copyFile(ffmpegFile, resolve(nwDir, ffmpegFile));
17
+ // don't do anything for windows because the extracted file is already in the correct path
18
+ // await copyFile(src, resolve(nwDir, ffmpegFile));
16
19
  } else if (platform === "osx") {
17
- await copyFile(
20
+ const dest = resolve(
21
+ nwDir,
22
+ "nwjs.app",
23
+ "Contents",
24
+ "Frameworks",
25
+ "nwjs Framework.framework",
26
+ "Versions",
27
+ "Current",
18
28
  ffmpegFile,
19
- resolve(
20
- nwDir,
21
- "Contents",
22
- "Frameworks",
23
- "nwjs Framework.framework",
24
- "Versions",
25
- "Current",
26
- ffmpegFile,
27
- ),
28
29
  );
30
+
31
+ await copyFile(src, dest);
29
32
  }
30
33
  };