Skip to content

Commit 826028e

Browse files
committed
replace fromDir
1 parent 56b8c09 commit 826028e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LayerCache.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ class LayerCache {
9393
}
9494

9595
private async moveLayerTarsInDir(fromDir: string, toDir: string) {
96-
const layerTars = (await recursiveReaddir(fromDir)).filter(path => path.endsWith(`/layer.tar`))
96+
const fromDirTrailingSlash = fromDir.endsWith(`/`) ? fromDir : `${fromDir}/`
97+
const layerTars = (await recursiveReaddir(fromDir))
98+
.filter(path => path.endsWith(`/layer.tar`))
99+
.map(path => path.replace(fromDirTrailingSlash, ``))
97100

98101
const moveLayer = async (layer: string) => {
99102
const from = path.resolve(`${fromDir}/${layer}`)

0 commit comments

Comments
 (0)