Compare commits
2 Commits
v0.1.0-bet
...
v0.1.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f78f708678 | ||
|
|
6fe7d54029 |
@@ -63,7 +63,7 @@ describe('context', () => {
|
||||
await Docker.context().catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['context', 'show'], {
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['context', 'inspect', '--format', '{{.Name}}'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
});
|
||||
|
||||
@@ -38,8 +38,12 @@ export class Docker {
|
||||
});
|
||||
}
|
||||
|
||||
public static async context(): Promise<string> {
|
||||
return await Exec.getExecOutput(`docker`, ['context', 'show'], {
|
||||
public static async context(name?: string): Promise<string> {
|
||||
const args = ['context', 'inspect', '--format', '{{.Name}}'];
|
||||
if (name) {
|
||||
args.push(name);
|
||||
}
|
||||
return await Exec.getExecOutput(`docker`, args, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
}).then(res => {
|
||||
|
||||
Reference in New Issue
Block a user