Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
try {
await shell.run('native-run', args, { showCommand: !args.includes('--json'), fatalOnNotFound: false, stream, ...options });
} catch (e) {
if (e instanceof SubprocessError && e.code === ERROR_COMMAND_NOT_FOUND) {
throw createNativeRunNotFoundError(config.get('npmClient'));
}
throw e;
}
// If we connect the `native-run` process to the running app, then we
// should also connect the Ionic CLI with the running `native-run` process.
// This will exit the Ionic CLI when `native-run` exits.
if (connect) {
processExit(0); // tslint:disable-line:no-floating-promises
}
}
} else if (err.code && err.code === 'ENOTFOUND' || err.code === 'ECONNREFUSED') {
ienv.log.error(
`Network connectivity error occurred, are you offline?\n` +
`If you are behind a firewall and need to configure proxy settings, see: ${strong('https://ion.link/cli-proxy-docs')}\n\n` +
failure(String(err.stack ? err.stack : err))
);
} else if (isExitCodeException(err)) {
if (err.message) {
if (err.exitCode > 0) {
ienv.log.error(err.message);
} else {
ienv.log.msg(err.message);
}
}
await processExit(err.exitCode);
} else if (err instanceof BaseError) {
ienv.log.error(err.message);
} else {
ienv.log.msg(failure(String(err.stack ? err.stack : err)));
if (err.stack) {
debug(failure(String(err.stack)));
}
}
}
}