fix(core): print error if there is an issue creating the sandbox during create (#5380)

This commit is contained in:
Jason Jean 2021-04-19 12:00:00 -04:00 committed by GitHub
parent 60de1f123d
commit fb0411ee8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -476,10 +476,23 @@ function createSandbox(packageManager: string) {
})
);
execSync(`${packageManager} install --silent`, {
cwd: tmpDir,
stdio: [0, 1, 2],
});
try {
execSync(`${packageManager} install --silent`, {
cwd: tmpDir,
stdio: 'ignore',
});
} catch (_) {
// Install failed so run again without --silent
try {
execSync(`${packageManager} install`, {
cwd: tmpDir,
stdio: [0, 1, 2],
});
} catch (e) {
// This will probably fail so we exit with the same status
process.exit(e.status);
}
}
return tmpDir;
}