From f5bc405f6f923b7dd8fde76764b32fbd0e272b8f Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Wed, 7 Dec 2022 19:19:00 +0100 Subject: [PATCH 1/2] ignore stdio in execSync --- packages/box/lib/utils/unbox.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/box/lib/utils/unbox.ts b/packages/box/lib/utils/unbox.ts index fc8d67ead89..0c8fe01f455 100644 --- a/packages/box/lib/utils/unbox.ts +++ b/packages/box/lib/utils/unbox.ts @@ -148,7 +148,7 @@ function installBoxDependencies({ hooks }: boxConfig, destination: string) { const postUnpack = hooks["post-unpack"]; if (postUnpack.length === 0) return; - execSync(postUnpack, { cwd: destination }); + execSync(postUnpack, { cwd: destination, stdio: "ignore" }); } export = { From 681a96d5b38ecd2d803038947fd70b816d8e5aa0 Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Thu, 8 Dec 2022 12:21:08 +0100 Subject: [PATCH 2/2] use spawnSync instead of execSync --- packages/box/lib/utils/unbox.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/box/lib/utils/unbox.ts b/packages/box/lib/utils/unbox.ts index 0c8fe01f455..e36600c6ed4 100644 --- a/packages/box/lib/utils/unbox.ts +++ b/packages/box/lib/utils/unbox.ts @@ -4,7 +4,7 @@ import download from "download-git-repo"; import axios from "axios"; import vcsurl from "vcsurl"; import { parse as parseURL } from "url"; -import { execSync } from "child_process"; +import { spawnSync } from "child_process"; import inquirer from "inquirer"; import type { Question } from "inquirer"; import type { boxConfig, unboxOptions } from "typings"; @@ -148,7 +148,12 @@ function installBoxDependencies({ hooks }: boxConfig, destination: string) { const postUnpack = hooks["post-unpack"]; if (postUnpack.length === 0) return; - execSync(postUnpack, { cwd: destination, stdio: "ignore" }); + + spawnSync(postUnpack, { + cwd: destination, + shell: true, + stdio: ["ignore", process.stdout, process.stderr] + }); } export = {