Merge pull request #51 from crazy-max/fix-docker-exporter

buildx: fix docker exporter check
This commit is contained in:
CrazyMax 2023-02-20 10:28:01 +01:00 committed by GitHub
commit 1383a2bcaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -228,6 +228,8 @@ describe('hasDockerExporter', () => {
[['type=docker', 'type=tar,dest=/tmp/image.tar'], true, undefined],
[['"type=tar","dest=/tmp/image.tar"'], false, undefined],
[['" type= local" , dest=./release-out'], false, undefined],
[['type=docker'], true, false],
[['type=docker'], true, true],
[['.'], true, true],
])('given %p returns %p', async (exporters: Array<string>, expected: boolean, load: boolean | undefined) => {
expect(Inputs.hasDockerExporter(exporters, load)).toEqual(expected);

View File

@ -134,7 +134,7 @@ export class Inputs {
}
public static hasDockerExporter(exporters: string[], load?: boolean): boolean {
return load ?? Inputs.hasExporterType('docker', exporters);
return load || Inputs.hasExporterType('docker', exporters);
}
public static hasExporterType(name: string, exporters: string[]): boolean {