From 3393b5e7fdbe500b178123533349429e93baf1d0 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 1 Jul 2021 17:02:30 +0200 Subject: [PATCH] Ensure trimmed output Signed-off-by: CrazyMax --- dist/index.js | 4 ++-- src/buildx.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7120f6a..d798b0b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -62,9 +62,9 @@ function getVersion() { }) .then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { - throw new Error(res.stderr); + throw new Error(res.stderr.trim()); } - return parseVersion(res.stdout); + return parseVersion(res.stdout.trim()); }); }); } diff --git a/src/buildx.ts b/src/buildx.ts index d61bb4c..6f9a6aa 100644 --- a/src/buildx.ts +++ b/src/buildx.ts @@ -23,9 +23,9 @@ export async function getVersion(): Promise { }) .then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { - throw new Error(res.stderr); + throw new Error(res.stderr.trim()); } - return parseVersion(res.stdout); + return parseVersion(res.stdout.trim()); }); }