runtime/local: fix unknown dir path (#1964)
Co-authored-by: Asim Aslam <asim@aslam.me> Co-authored-by: Janos Dobronszki <dobronszki@gmail.com>
This commit is contained in:
parent
21004341bf
commit
0adb469a85
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user