From 50cf92b5bbc883ec91374ee3e7e356a0ea741784 Mon Sep 17 00:00:00 2001 From: satackey <21271711+satackey@users.noreply.github.com> Date: Sat, 15 Aug 2020 15:49:23 +0900 Subject: [PATCH] update moveLayerTarsInDir --- src/LayerCache.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/LayerCache.ts b/src/LayerCache.ts index 3c8b72a1..54c7464f 100644 --- a/src/LayerCache.ts +++ b/src/LayerCache.ts @@ -90,10 +90,9 @@ class LayerCache { } private async moveLayerTarsInDir(fromDir: string, toDir: string) { - const fromDirTrailingSlash = fromDir.endsWith(`/`) ? fromDir : `${fromDir}/` const layerTars = (await recursiveReaddir(fromDir)) .filter(path => path.endsWith(`/layer.tar`)) - .map(path => path.replace(fromDirTrailingSlash, ``)) + .map(path => path.replace(`${fromDir}/`, ``)) const moveLayer = async (layer: string) => { const from = path.resolve(`${fromDir}/${layer}`)