Skip to content

Commit 8edf211

Browse files
committed
Update exec
1 parent 5f8502e commit 8edf211

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/ImageDetector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class ImageDetector {
55
async getExistingImages(): Promise<string[]> {
66
const existingSet = new Set<string>([])
77
const ids = (await exec.exec(`docker image ls -q`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``)
8-
const repotags = (await exec.exec(`sh -c "docker image ls --format '{{ .Repository }}:{{ .Tag }}' --filter 'dangling=false'"`, [], { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``);
8+
const repotags = (await exec.exec(`docker`, `image ls --format {{.Repository}}:{{.Tag}} --filter dangling=false`.split(' '), { silent: true })).stdoutStr.split(`\n`).filter(id => id !== ``);
99
core.debug(JSON.stringify({ log: "getExistingImages", ids, repotags }));
1010
([...ids, ...repotags]).forEach(image => existingSet.add(image))
1111
core.debug(JSON.stringify({ existingSet }))

src/LayerCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class LayerCache {
4949
}
5050

5151
private async saveImageAsUnpacked() {
52-
await this.exec('mkdir -p', [this.getSavedImageTarDir()], { silent: true })
53-
await this.exec(`sh -c`, [`docker save '${(await this.makeRepotagsDockerSaveArgReady(this.ids)).join(`' '`)}' | tar xf - -C ${this.getSavedImageTarDir()}`])
52+
await fs.mkdir(this.getSavedImageTarDir(), { recursive: true })
53+
await this.exec(`sh -c`, [`docker save '${(await this.makeRepotagsDockerSaveArgReady(this.ids)).join(`' '`)}' | tar xf - -C .`], { cwd: this.getSavedImageTarDir() })
5454
}
5555

5656
private async makeRepotagsDockerSaveArgReady(repotags: string[]): Promise<string[]> {

0 commit comments

Comments
 (0)