Small typo and ensure trimmed output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-07-01 16:55:21 +02:00
parent 0987321e12
commit fcaaa5e487
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 4 additions and 4 deletions

4
dist/index.js generated vendored
View File

@ -152,7 +152,7 @@ function getVersion() {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim()); throw new Error(res.stderr.trim());
} }
return parseVersion(res.stdout); return parseVersion(res.stdout.trim());
}); });
}); });
} }
@ -473,7 +473,7 @@ function run() {
}) })
.then(res => { .then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(`buildx bake failed with: ${res.stderr.match(/(.*)\s*$/)[0].trim()}`); throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)[0].trim()}`);
} }
}); });
const imageID = yield buildx.getImageID(); const imageID = yield buildx.getImageID();

View File

@ -103,7 +103,7 @@ export async function getVersion(): Promise<string> {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim()); throw new Error(res.stderr.trim());
} }
return parseVersion(res.stdout); return parseVersion(res.stdout.trim());
}); });
} }

View File

@ -29,7 +29,7 @@ async function run(): Promise<void> {
}) })
.then(res => { .then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) { if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(`buildx bake failed with: ${res.stderr.match(/(.*)\s*$/)![0].trim()}`); throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)![0].trim()}`);
} }
}); });