docker: context method
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -38,6 +38,18 @@ export class Docker {
|
||||
});
|
||||
}
|
||||
|
||||
public static async context(): Promise<string> {
|
||||
return await Exec.getExecOutput(`docker`, ['context', 'show'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
return res.stdout.trim();
|
||||
});
|
||||
}
|
||||
|
||||
public static async printVersion(): Promise<void> {
|
||||
await Exec.exec('docker', ['version']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user