Add digest output

Fix platforms and allow inputs

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-17 22:18:15 +02:00
parent 44d05b9191
commit 38c1f188ca
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
8 changed files with 244 additions and 68 deletions

View file

@ -1,5 +1,20 @@
import fs from 'fs';
import path from 'path';
import * as context from './context';
import * as exec from './exec';
export async function getImageIDFile(): Promise<string> {
return path.join(context.tmpDir, 'iidfile');
}
export async function getImageID(): Promise<string | undefined> {
const iidFile = await getImageIDFile();
if (!fs.existsSync(iidFile)) {
return undefined;
}
return fs.readFileSync(iidFile, {encoding: 'utf-8'});
}
export async function isAvailable(): Promise<Boolean> {
return await exec.exec(`docker`, ['buildx'], true).then(res => {
if (res.stderr != '' && !res.success) {