diff --git a/__tests__/docker.test.ts b/__tests__/docker.test.ts index 9735031..a0381a4 100644 --- a/__tests__/docker.test.ts +++ b/__tests__/docker.test.ts @@ -50,7 +50,7 @@ describe('configDir', () => { describe('isAvailable', () => { it('cli', () => { const execSpy = jest.spyOn(exec, 'getExecOutput'); - Docker.isAvailable(); + Docker.isAvailable; // eslint-disable-next-line jest/no-standalone-expect expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, { silent: true, diff --git a/src/buildx/buildx.ts b/src/buildx/buildx.ts index ed3fce2..a46cdf4 100644 --- a/src/buildx/buildx.ts +++ b/src/buildx/buildx.ts @@ -39,7 +39,7 @@ export class Buildx { this.context = opts.context; this.inputs = new Inputs(this.context); this.install = new Install({standalone: opts.standalone}); - this.standalone = opts?.standalone ?? !Docker.isAvailable(); + this.standalone = opts?.standalone ?? !Docker.isAvailable; } public getCommand(args: Array) { diff --git a/src/docker.ts b/src/docker.ts index 186c43e..2b86de7 100644 --- a/src/docker.ts +++ b/src/docker.ts @@ -23,7 +23,7 @@ export class Docker { return process.env.DOCKER_CONFIG || path.join(os.homedir(), '.docker'); } - public static isAvailable(): boolean { + static get isAvailable(): boolean { let dockerAvailable = false; exec .getExecOutput('docker', undefined, { @@ -45,7 +45,7 @@ export class Docker { } public static async printVersion(standalone?: boolean) { - const noDocker = standalone ?? !Docker.isAvailable(); + const noDocker = standalone ?? !Docker.isAvailable; if (noDocker) { return; } @@ -55,7 +55,7 @@ export class Docker { } public static async printInfo(standalone?: boolean) { - const noDocker = standalone ?? !Docker.isAvailable(); + const noDocker = standalone ?? !Docker.isAvailable; if (noDocker) { return; }