Skip to content

Commit

Permalink
wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-patras committed Apr 8, 2019
1 parent b12b402 commit 722256c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/insomnia-app/app/plugins/install.js
Expand Up @@ -88,7 +88,8 @@ async function _isInsomniaPlugin(lookupName: string): Promise<Object> {
yarnOutput = JSON.parse(stdout.toString('utf8'));
} catch (ex) {
//Output is not JSON. Check if yarn/electron might terminated with non-zero exit code.
//In certain environments electron can exit with error even if output is OK. Parsing is attemted before checking exit code as workaround for false errors.
//In certain environments electron can exit with error even if output is OK.
//Parsing is attemted before checking exit code as workaround for false errors.
if (err) {
reject(new Error(`${lookupName} npm error: ${err.message}`));
} else {
Expand Down Expand Up @@ -150,8 +151,9 @@ async function _installPluginToTmpDir(lookupName: string): Promise<{ tmpDir: str
},
},
(err, stdout, stderr) => {
//Check Yarn/electron process exit code.
//In certain environments electron can exit with error even if the command was perfomed sucesfully. Checking for sucess message in output is a workaround for false errors.
//Check yarn/electron process exit code.
//In certain environments electron can exit with error even if the command was perfomed sucesfully.
//Checking for sucess message in output is a workaround for false errors.
if (err && !stdout.toString('utf8').includes('success')) {
reject(new Error(`${lookupName} install error: ${err.message}`));
return;
Expand Down

0 comments on commit 722256c

Please sign in to comment.