diff --git a/electron/exposes/adbkit/index.js b/electron/exposes/adbkit/index.js index bc0f05c..be586bb 100644 --- a/electron/exposes/adbkit/index.js +++ b/electron/exposes/adbkit/index.js @@ -68,11 +68,11 @@ const spawnShell = async (command, { stdout, stderr } = {}) => { } }) - let lastStderr = '' + const stderrList = [] spawnProcess.stderr.on('data', (data) => { const stringData = data.toString() - lastStderr = stringData + stderrList.push(stringData) console.error('spawnProcess.stderr.data:', stringData) @@ -87,7 +87,9 @@ const spawnShell = async (command, { stdout, stderr } = {}) => { resolve() } else { - reject(new Error(lastStderr || `Command failed with code ${code}`)) + reject( + new Error(stderrList.join(',') || `Command failed with code ${code}`), + ) } }) diff --git a/electron/exposes/gnirehtet/index.js b/electron/exposes/gnirehtet/index.js index 2daf896..3dcb480 100644 --- a/electron/exposes/gnirehtet/index.js +++ b/electron/exposes/gnirehtet/index.js @@ -46,11 +46,11 @@ const shell = async (command, { debug = false, stdout, stderr } = {}) => { } }) - let lastStderr = '' + const stderrList = [] gnirehtetProcess.stderr.on('data', (data) => { const stringData = data.toString() - lastStderr = stringData + stderrList.push(stringData) if (debug) { console.error(`${command}.gnirehtet.process.stderr.data:`, stringData) @@ -69,7 +69,9 @@ const shell = async (command, { debug = false, stdout, stderr } = {}) => { resolve() } else { - reject(new Error(`Command failed with code ${code}`)) + reject( + new Error(stderrList.join(',') || `Command failed with code ${code}`), + ) } }) diff --git a/electron/exposes/scrcpy/index.js b/electron/exposes/scrcpy/index.js index d503582..7ea2fa9 100644 --- a/electron/exposes/scrcpy/index.js +++ b/electron/exposes/scrcpy/index.js @@ -33,11 +33,11 @@ const shell = async (command, { stdout, stderr } = {}) => { } }) - let lastStderr = '' + const stderrList = [] scrcpyProcess.stderr.on('data', (data) => { const stringData = data.toString() - lastStderr = stringData + stderrList.push(stringData) console.error('scrcpyProcess.stderr.data:', stringData) @@ -52,7 +52,9 @@ const shell = async (command, { stdout, stderr } = {}) => { resolve() } else { - reject(new Error(lastStderr || `Command failed with code ${code}`)) + reject( + new Error(stderrList.join(',') || `Command failed with code ${code}`), + ) } })