Skip to content

Commit 7aa894c

Browse files
committed
add filter
1 parent 03ad4f6 commit 7aa894c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/LayerCache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ class LayerCache {
6060
}
6161

6262
private async separateAllLayerCaches() {
63-
await this.moveLayerTars(this.getUnpackedTarDir(), this.getLayerCachesDir())
63+
await this.moveLayerTarsInDir(this.getUnpackedTarDir(), this.getLayerCachesDir())
6464
}
6565

6666
private async joinAllLayerCaches() {
67-
await this.moveLayerTars(this.getLayerCachesDir(), this.getUnpackedTarDir())
67+
await this.moveLayerTarsInDir(this.getLayerCachesDir(), this.getUnpackedTarDir())
6868
}
6969

70-
private async moveLayerTars(fromDir: string, toDir: string) {
71-
const layerTars = (await exec.exec(`find . -name layer.tar`, [], { cwd: fromDir })).stdoutStr.split(`\n`)
70+
private async moveLayerTarsInDir(fromDir: string, toDir: string) {
71+
const layerTars = (await exec.exec(`find . -name layer.tar`, [], { cwd: fromDir })).stdoutStr.split(`\n`).filter(tar => tar !== '')
7272
const moveLayer = async (layer: string) => {
7373
const from = path.resolve(`${fromDir}/${layer}`)
7474
const to = path.resolve(`${toDir}/${layer}`)

0 commit comments

Comments
 (0)