mirror of
https://github.com/docker/setup-buildx-action.git
synced 2025-07-19 21:18:26 +02:00
support standalone mode and display version
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
2a6fbda6d8
commit
3472856dd9
9 changed files with 223 additions and 46 deletions
19
src/docker.ts
Normal file
19
src/docker.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
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;
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue