Skip to content

Commit

Permalink
fix: modes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayushman Chhabra committed Jul 25, 2023
1 parent 6cfeef3 commit 78bf5d3
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,20 @@ const nwbuild = async (options) => {
}-${options.arch}`
);

// Downloading binaries is required for run and build modes
if (options.mode === "get") {
// Download NW.js binaries
// Download NW.js binaries
await get({
version: options.version,
flavor: options.flavor,
platform: options.platform,
arch: options.arch,
downloadUrl: options.downloadUrl,
cacheDir: options.cacheDir,
cache: options.cache,
ffmpeg: false,
});

// Download ffmpeg binaries and replace chromium ffmpeg
if (options.ffmpeg === true) {
await get({
version: options.version,
flavor: options.flavor,
Expand All @@ -115,22 +126,13 @@ const nwbuild = async (options) => {
downloadUrl: options.downloadUrl,
cacheDir: options.cacheDir,
cache: options.cache,
ffmpeg: false,
ffmpeg: true,
});
}

// Download ffmpeg binaries and replace chromium ffmpeg
if (options.ffmpeg === true) {
await get({
version: options.version,
flavor: options.flavor,
platform: options.platform,
arch: options.arch,
downloadUrl: options.downloadUrl,
cacheDir: options.cacheDir,
cache: options.cache,
ffmpeg: true,
});
}
if (options.mode === "get") {
// Do nothing since we have already downloaded the binaries
return;
}

if (options.mode === "run") {
Expand Down

0 comments on commit 78bf5d3

Please sign in to comment.