From fa94df284c3e6d23e0efd44d363b71b564cf1f26 Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Sun, 24 Nov 2024 14:15:38 +0530 Subject: [PATCH] fix(run): return NW.js Node process during run mode from nwbuild function --- src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 4032af0f..7fc3125e 100644 --- a/src/index.js +++ b/src/index.js @@ -36,7 +36,7 @@ import util from './util.js'; * @async * @function * @param {Options} options Options - * @returns {Promise} + * @returns {Promise} */ async function nwbuild(options) { let built; @@ -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, @@ -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({ @@ -147,6 +148,8 @@ async function nwbuild(options) { console.error(error); throw error; } + + return undefined; } export default nwbuild;