nw-builder
Advanced tools
Comparing version 4.4.0 to 4.4.1
{ | ||
"name": "nw-builder", | ||
"version": "4.4.0", | ||
"version": "4.4.1", | ||
"description": "Build NW.js desktop applications for MacOS, Windows and Linux.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -66,5 +66,31 @@ import { createWriteStream, existsSync } from "node:fs"; | ||
const unzipFFMPeg = async () => { | ||
if (platform === "linux") { | ||
await compressing.tgz.uncompress(out, nwDir); | ||
} else { | ||
await compressing.zip.uncompress(out, nwDir); | ||
} | ||
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); | ||
if (cache === false) { | ||
log.debug(`Removing FFMPEG zip cache`); | ||
await rm(out, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
log.debug(`FFMPEG zip cache removed`); | ||
} | ||
}; | ||
// Check if cache exists. | ||
if (existsSync(out)) { | ||
log.debug(`Found existing FFMPEG cache`); | ||
await unzipFFMPeg(); | ||
return; | ||
@@ -98,7 +124,3 @@ } | ||
bar.stop(); | ||
if (platform === "linux") { | ||
compressing.tgz.uncompress(out, nwDir).then(() => resolve()); | ||
} else { | ||
compressing.zip.uncompress(out, nwDir).then(() => resolve()); | ||
} | ||
resolve(); | ||
}); | ||
@@ -116,22 +138,3 @@ | ||
// Remove compressed file after download and decompress. | ||
return request.then(async () => { | ||
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); | ||
if (cache === false) { | ||
log.debug(`Removing FFMPEG zip cache`); | ||
await rm(out, { | ||
recursive: true, | ||
force: true, | ||
}); | ||
log.debug(`FFMPEG zip cache removed`); | ||
} | ||
}); | ||
return request.then(unzipFFMPeg); | ||
} |
@@ -96,6 +96,9 @@ import { mkdir } from "node:fs/promises"; | ||
if (options.logLevel === "debug") { | ||
log.debug(`Platform: ${platform}`); | ||
log.debug(`Archicture: ${arch}`); | ||
log.debug(`System Platform: ${platform}`); | ||
log.debug(`System Architecture: ${arch}`); | ||
log.debug(`Node Version: ${version}`); | ||
log.debug(`NW.js Version: ${options.version}\n`); | ||
log.debug(`Build NW.js Version: ${options.version}`); | ||
log.debug(`Build Flavor: ${options.flavor}`); | ||
log.debug(`Build Platform: ${options.platform}`); | ||
log.debug(`Build Architecture: ${options.arch}`); | ||
} | ||
@@ -102,0 +105,0 @@ |
@@ -57,3 +57,3 @@ import { spawn } from "node:child_process"; | ||
resolve(nwDir, EXE_NAME[platform]), | ||
[srcDir.concat(argv)], | ||
[...[srcDir], ...argv], | ||
{ | ||
@@ -60,0 +60,0 @@ detached: true, |
57375
1375