mirror of
https://github.com/docker/build-push-action
synced 2024-11-23 10:41:42 +00:00
20 lines
476 B
TypeScript
20 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;
|
||
|
});
|
||
|
}
|