Fix running subfolders (#1998)
This commit is contained in:
@@ -95,14 +95,14 @@ func (r *localRuntime) checkoutSourceIfNeeded(s *runtime.Service, secrets map[st
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(sourceParts) > 1 {
|
if len(sourceParts) > 1 {
|
||||||
lastFolderPart := s.Name
|
lastFolderPart := tarName
|
||||||
fullp := append([]string{uncompressPath}, sourceParts[1:]...)
|
fullp := append([]string{uncompressPath}, sourceParts[1:]...)
|
||||||
s.Source = filepath.Join(append(fullp, lastFolderPart)...)
|
s.Source = filepath.Join(append(fullp, lastFolderPart)...)
|
||||||
} else {
|
} else {
|
||||||
// The tar name is 'helloworld' for both
|
// The tar name is 'helloworld' for both
|
||||||
// the case when the code is uploaded from `$REPO/helloworld`
|
// the case when the code is uploaded from `$REPO/helloworld`
|
||||||
// and when it's uploaded from outside a repo ie `~/helloworld`.
|
// and when it's uploaded from outside a repo ie `~/helloworld`.
|
||||||
if _, err := Entrypoint(filepath.Join(s.Source, tarName)); err == nil {
|
if _, err := Entrypoint(filepath.Join(uncompressPath, tarName)); err == nil {
|
||||||
s.Source = filepath.Join(uncompressPath, tarName)
|
s.Source = filepath.Join(uncompressPath, tarName)
|
||||||
} else {
|
} else {
|
||||||
s.Source = uncompressPath
|
s.Source = uncompressPath
|
||||||
|
|||||||
Reference in New Issue
Block a user