buildx: debug logs in isAvailable method

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-02-19 02:50:53 +01:00
parent e9db81b6a1
commit 768df5fbf4
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7

View File

@ -70,21 +70,26 @@ export class Buildx {
public async isAvailable(): Promise<boolean> {
const cmd = await this.getCommand([]);
return await exec
const ok: boolean = await exec
.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.debug(`Buildx.isAvailable cmd err: ${res.stderr}`);
return false;
}
return res.exitCode == 0;
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.catch(error => {
core.debug(`Buildx.isAvailable error: ${error}`);
return false;
});
core.debug(`Buildx.isAvailable: ${ok}`);
return ok;
}
public async printInspect(name: string): Promise<void> {