Skip to content

Commit

Permalink
fix(run): return NW.js Node process during run mode from nwbuild func…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
ayushmanchhabra committed Nov 24, 2024
1 parent b9e89ec commit fa94df2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import util from './util.js';
* @async
* @function
* @param {Options} options Options
* @returns {Promise<void>}
* @returns {Promise<child_process.ChildProcess | null | undefined>}
*/
async function nwbuild(options) {
let built;
Expand Down Expand Up @@ -108,12 +108,12 @@ async function nwbuild(options) {

if (options.mode === 'get') {
// Do nothing else since we have already downloaded the binaries.
return;
return undefined;
}

if (options.mode === 'run') {
util.log('info', options.logLevel, 'Running NW.js in run mode...');
await run({
const nwProcess = await run({
version: options.version,
flavor: options.flavor,
platform: options.platform,
Expand All @@ -123,6 +123,7 @@ async function nwbuild(options) {
glob: options.glob,
argv: options.argv,
});
return nwProcess;
} else if (options.mode === 'build') {
util.log('info', options.logLevel, `Build a NW.js application for ${options.platform} ${options.arch}...`);
await bld({
Expand All @@ -147,6 +148,8 @@ async function nwbuild(options) {
console.error(error);
throw error;
}

return undefined;
}

export default nwbuild;

0 comments on commit fa94df2

Please sign in to comment.