nw-builder
Advanced tools
Comparing version 4.3.6 to 4.3.7
{ | ||
"name": "nw-builder", | ||
"version": "4.3.6", | ||
"version": "4.3.7", | ||
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -184,3 +184,11 @@ import { createWriteStream } from "node:fs"; | ||
if (ffmpeg === true) { | ||
await replaceFfmpeg(platform, nwDir, out); | ||
let ffmpegFile; | ||
if (platform === "linux") { | ||
ffmpegFile = "libffmpeg.so"; | ||
} else if (platform === "win") { | ||
ffmpegFile = "ffmpeg.dll"; | ||
} else if (platform === "osx") { | ||
ffmpegFile = "libffmpeg.dylib"; | ||
} | ||
await replaceFfmpeg(platform, nwDir, ffmpegFile); | ||
} | ||
@@ -187,0 +195,0 @@ |
@@ -12,20 +12,23 @@ import { copyFile } from "node:fs/promises"; | ||
export const replaceFfmpeg = async (platform, nwDir, ffmpegFile) => { | ||
const src = resolve(nwDir, ffmpegFile); | ||
if (platform === "linux") { | ||
await copyFile(ffmpegFile, resolve(nwDir, "lib", ffmpegFile)); | ||
const dest = resolve(nwDir, "lib", ffmpegFile); | ||
await copyFile(src, dest); | ||
} else if (platform === "win") { | ||
await copyFile(ffmpegFile, resolve(nwDir, ffmpegFile)); | ||
// don't do anything for windows because the extracted file is already in the correct path | ||
// await copyFile(src, resolve(nwDir, ffmpegFile)); | ||
} else if (platform === "osx") { | ||
await copyFile( | ||
const dest = resolve( | ||
nwDir, | ||
"nwjs.app", | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Versions", | ||
"Current", | ||
ffmpegFile, | ||
resolve( | ||
nwDir, | ||
"Contents", | ||
"Frameworks", | ||
"nwjs Framework.framework", | ||
"Versions", | ||
"Current", | ||
ffmpegFile, | ||
), | ||
); | ||
await copyFile(src, dest); | ||
} | ||
}; |
53791
1283