From 0adb469a854a85fadce45cec754caebc00aaa372 Mon Sep 17 00:00:00 2001 From: ben-toogood Date: Mon, 24 Aug 2020 14:23:44 +0100 Subject: [PATCH] runtime/local: fix unknown dir path (#1964) Co-authored-by: Asim Aslam Co-authored-by: Janos Dobronszki --- runtime/local/local.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/local/local.go b/runtime/local/local.go index f1aea4a3..77c3d8d6 100644 --- a/runtime/local/local.go +++ b/runtime/local/local.go @@ -75,8 +75,9 @@ func (r *localRuntime) checkoutSourceIfNeeded(s *runtime.Service, secrets map[st sourceParts := strings.Split(s.Source, "/") compressedFilepath := filepath.Join(SourceDir, sourceParts[0]) uncompressPath := strings.ReplaceAll(compressedFilepath, ".tar.gz", "") + tarName := strings.ReplaceAll(sourceParts[0], ".tar.gz", "") if len(sourceParts) > 1 { - uncompressPath = filepath.Join(SourceDir, strings.ReplaceAll(sourceParts[0], ".tar.gz", "")) + uncompressPath = filepath.Join(SourceDir, tarName) } // check if the directory already exists @@ -98,7 +99,7 @@ func (r *localRuntime) checkoutSourceIfNeeded(s *runtime.Service, secrets map[st fullp := append([]string{uncompressPath}, sourceParts[1:]...) s.Source = filepath.Join(append(fullp, lastFolderPart)...) } else { - s.Source = uncompressPath + s.Source = filepath.Join(uncompressPath, tarName) } return nil }