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()); }); }