mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
buildx: debug logs in isAvailable method
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
e9db81b6a1
commit
768df5fbf4
@ -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> {
|
||||
|
Loading…
Reference in New Issue
Block a user