From 469a78512f7e5ce2405cf87477505a25852818ee Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:55:44 +0100 Subject: [PATCH] feat: use execa --- src/git/cli.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/git/cli.ts b/src/git/cli.ts index cbf2a1b..0ee85a2 100644 --- a/src/git/cli.ts +++ b/src/git/cli.ts @@ -3,15 +3,12 @@ * * Run Git CLI commands within the extension and capture the text output. */ -import { exec as _exec } from "child_process"; -import * as util from "util"; +import { execa } from "execa"; import { Repository } from "../api/git"; -const exec = util.promisify(_exec); - // Ensure Git will show special characters literally without quoting the string // and escaping characters. -const QUOTE_PATH = '-c "core.quotePath=false"'; +const QUOTE_PATH = ["-c", "core.quotePath=false"]; const DIFF_INDEX_CMD = "diff-index"; const DIFF_INDEX_OPTIONS = [ @@ -29,7 +26,7 @@ function _execute(cwd: string, subcommand: string, options: string[] = []) { console.debug(`Running command: ${command}, cwd: ${cwd}`); - return exec(command, { cwd }); + return execa(command, { cwd }); } /**