From 79b09555d9657fd0fe60953f5feb6e90b4666398 Mon Sep 17 00:00:00 2001 From: Kurt Goolsbee Date: Tue, 5 Mar 2024 11:25:39 -0600 Subject: [PATCH] fix(turbo-git): the execSync function was calling exec. exec is an async function When exec is called from a sync function the response is a promise. When you call toString on the promise you do not get the results of the command that was execured but rather a string like [Object]. Changed the execSync function to call the sync version of the exec command. --- packages/turbo-git/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/turbo-git/src/index.ts b/packages/turbo-git/src/index.ts index 962c6d5..2f09cbe 100644 --- a/packages/turbo-git/src/index.ts +++ b/packages/turbo-git/src/index.ts @@ -1,4 +1,4 @@ -import { exec } from "child_process"; +import { exec, execSync as syncExec } from "child_process"; import { existsSync, statSync } from "fs"; import { join } from "path"; import { cwd } from "process"; @@ -11,7 +11,7 @@ const execAsync = function (command: string) { }; const execSync = function (command: string, args?: any) { - return exec(command, { maxBuffer: 1024 * 1024 * 10, ...args }); + return syncExec(command, { maxBuffer: 1024 * 1024 * 10, ...args }); }; type GitTagOptions = {