1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2024-11-22 08:54:57 +00:00
setup-buildx-action/src/docker.ts
CrazyMax 3472856dd9
support standalone mode and display version
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-17 17:22:11 +02:00

19 lines
476 B
TypeScript

import * as exec from '@actions/exec';
export async function isAvailable(): Promise<boolean> {
return await exec
.getExecOutput('docker', undefined, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
return false;
}
return res.exitCode == 0;
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.catch(error => {
return false;
});
}