Skip to content

Commit

Permalink
run wait for install (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Avery Harnish <[email protected]>
Co-authored-by: avery <[email protected]>
  • Loading branch information
3 people authored May 4, 2023
1 parent b1b82e5 commit e5d2c29
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions packages/binary-install/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,28 @@ class Binary {
}

run(fetchOptions) {
if (!this.exists()) {
this.install(fetchOptions, true);
}
const promise = !this.exists()
? this.install(fetchOptions, true)
: Promise.resolve();

const [, , ...args] = process.argv;
promise
.then(() => {
const [, , ...args] = process.argv;

const options = { cwd: process.cwd(), stdio: "inherit" };
const options = { cwd: process.cwd(), stdio: "inherit" };

const result = spawnSync(this.binaryPath, args, options);
const result = spawnSync(this.binaryPath, args, options);

if (result.error) {
error(result.error);
}
if (result.error) {
error(result.error);
}

process.exit(result.status);
process.exit(result.status);
})
.catch(e => {
error(e.message);
process.exit(1);
});
}
}

Expand Down

0 comments on commit e5d2c29

Please sign in to comment.