3
0
Fork 0
mirror of https://gitea.com/docker/build-push-action.git synced 2024-11-26 11:29:38 +01:00
docker-build-push/src/docker.ts

20 lines
476 B
TypeScript
Raw Normal View History

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;
});
}