From 77821354eb51a9b71ece5d0bbc15be2c54222d0c Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 26 Aug 2024 19:09:30 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> --- package.json | 2 +- src/detect.ts | 1 + src/runner.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index f718d0f..e211c1e 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "picocolors": "^1.0.1", "taze": "^0.16.3", "terminal-link": "^3.0.0", - "tinyexec": "^0.2.0", + "tinyexec": "^0.3.0", "tinyglobby": "^0.2.2", "tsx": "^4.17.0", "typescript": "^5.5.4", diff --git a/src/detect.ts b/src/detect.ts index 9e8aa3c..efd9615 100644 --- a/src/detect.ts +++ b/src/detect.ts @@ -51,6 +51,7 @@ export async function detect({ autoInstall, programmatic, cwd }: DetectOptions = stdio: 'inherit', cwd, }, + throwOnError: true, }, ) } diff --git a/src/runner.ts b/src/runner.ts index 9e1a0aa..d179d88 100644 --- a/src/runner.ts +++ b/src/runner.ts @@ -90,6 +90,7 @@ export async function run(fn: Runner, args: string[], options: DetectOptions = { nodeOptions: { cwd, }, + throwOnError: true, } satisfies Partial const getV = (a: string) => { const [command, ...xArguments] = getCmd(a as Agent).split(' ') @@ -155,5 +156,6 @@ export async function run(fn: Runner, args: string[], options: DetectOptions = { stdio: 'inherit', cwd, }, + throwOnError: true, }) }