fix: print non-empty stderr

Signed-off-by: eine <eine@users.noreply.github.com>
This commit is contained in:
eine 2020-11-04 19:17:53 +01:00
parent 1cce1654e0
commit 19329d1409
2 changed files with 13 additions and 4 deletions

9
dist/index.js generated vendored
View File

@ -242,8 +242,13 @@ function loginStandard(registry, username, password) {
input: Buffer.from(password)
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
if (res.stderr.length > 0) {
if (res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
else {
core.warning(res.stderr);
}
}
core.info(`Login Succeeded!`);
});

View File

@ -43,8 +43,12 @@ export async function loginStandard(registry: string, username: string, password
input: Buffer.from(password)
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
if (res.stderr.length > 0) {
if (res.exitCode != 0) {
throw new Error(res.stderr.trim());
} else {
core.warning(res.stderr);
}
}
core.info(`Login Succeeded!`);
});