From 5ae4ffe22ef13311a73183d2109fe74051b9dcc7 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Thu, 23 Dec 2021 16:39:13 +0300 Subject: [PATCH] add trim --- dist/cache-save/index.js | 2 +- dist/setup/index.js | 2 +- src/cache-utils.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 415c3ea4..b24c7c9c 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -3838,7 +3838,7 @@ exports.supportedPackageManagers = { exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true }); if (exitCode) { - stderr = !stderr + stderr = !stderr.trim() ? `The '${toolCommand}' command failed with exit code: ${exitCode}` : stderr; throw new Error(stderr); diff --git a/dist/setup/index.js b/dist/setup/index.js index ff1c5a55..c6a63f28 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -46209,7 +46209,7 @@ exports.supportedPackageManagers = { exports.getCommandOutput = (toolCommand) => __awaiter(void 0, void 0, void 0, function* () { let { stdout, stderr, exitCode } = yield exec.getExecOutput(toolCommand, undefined, { ignoreReturnCode: true }); if (exitCode) { - stderr = !stderr + stderr = !stderr.trim() ? `The '${toolCommand}' command failed with exit code: ${exitCode}` : stderr; throw new Error(stderr); diff --git a/src/cache-utils.ts b/src/cache-utils.ts index 4d11510e..36531bd5 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -37,7 +37,7 @@ export const getCommandOutput = async (toolCommand: string) => { ); if (exitCode) { - stderr = !stderr + stderr = !stderr.trim() ? `The '${toolCommand}' command failed with exit code: ${exitCode}` : stderr; throw new Error(stderr);