From f6761e42a35af89c6c45adf7b0bfe65ec6c6a7b3 Mon Sep 17 00:00:00 2001 From: AgentEnder Date: Fri, 31 Mar 2023 15:20:44 -0400 Subject: [PATCH] fix(misc): create-nx-workspace should show some stdout if stderr empty on error --- packages/create-nx-workspace/src/utils/child-process-utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/create-nx-workspace/src/utils/child-process-utils.ts b/packages/create-nx-workspace/src/utils/child-process-utils.ts index 708e12aa85067..9b57d4cb97122 100644 --- a/packages/create-nx-workspace/src/utils/child-process-utils.ts +++ b/packages/create-nx-workspace/src/utils/child-process-utils.ts @@ -33,7 +33,8 @@ export function execAndWait(command: string, cwd: string) { if (error) { const logFile = join(cwd, 'error.log'); writeFileSync(logFile, `${stdout}\n${stderr}`); - rej(new CreateNxWorkspaceError(stderr, error.code, logFile)); + const message = stderr && stderr.trim().length ? stderr : stdout; + rej(new CreateNxWorkspaceError(message, error.code, logFile)); } else { res({ code: 0, stdout }); }