From 505c5ef752de2313c61dda65687ffb4d1a6059e7 Mon Sep 17 00:00:00 2001 From: Yingchi Long Date: Sun, 23 Jun 2024 19:55:08 +0800 Subject: [PATCH] cli: remove sync version --- src/cli.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index d48b4c6..4104350 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,21 +1,4 @@ -import { ChildProcess, SpawnSyncOptionsWithBufferEncoding, SpawnSyncReturns, spawnSync as rawSpawnSync } from "child_process"; - -export function check(result: SpawnSyncReturns) { - if (result.error) - throw result.error; - if (result.status !== 0) { - throw result.stderr; - } - return result; -} - -export function checkedSpawnSync( - command: string, - args: readonly string[], - options: SpawnSyncOptionsWithBufferEncoding, -): SpawnSyncReturns { - return check(rawSpawnSync(command, args, options)); -} +import { ChildProcess } from "child_process"; export function promisifySpawn(p: T) { return new Promise((resolve, reject) => {