mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-26 22:26:08 +08:00
Merge pull request #51 from crazy-max/fix-docker-exporter
buildx: fix docker exporter check
This commit is contained in:
commit
1383a2bcaf
@ -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);
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user