buildx: debug logs in isAvailable method
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -70,21 +70,26 @@ export class Buildx {
|
|||||||
|
|
||||||
public async isAvailable(): Promise<boolean> {
|
public async isAvailable(): Promise<boolean> {
|
||||||
const cmd = await this.getCommand([]);
|
const cmd = await this.getCommand([]);
|
||||||
return await exec
|
|
||||||
|
const ok: boolean = await exec
|
||||||
.getExecOutput(cmd.command, cmd.args, {
|
.getExecOutput(cmd.command, cmd.args, {
|
||||||
ignoreReturnCode: true,
|
ignoreReturnCode: true,
|
||||||
silent: true
|
silent: true
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
core.debug(`Buildx.isAvailable cmd err: ${res.stderr}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return res.exitCode == 0;
|
return res.exitCode == 0;
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
core.debug(`Buildx.isAvailable error: ${error}`);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
core.debug(`Buildx.isAvailable: ${ok}`);
|
||||||
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async printInspect(name: string): Promise<void> {
|
public async printInspect(name: string): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user