Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
aws.lambda.Function: fix Handelr not found issue when absolute paths …
Browse files Browse the repository at this point in the history
…are passed in
  • Loading branch information
thdxr committed Oct 11, 2024
1 parent d3efe39 commit de4b2c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/runtime/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ func (r *Runtime) getFile(input *runtime.BuildInput) (string, bool) {
fileSplit := strings.Split(filepath.Base(input.Handler), ".")
base := strings.Join(fileSplit[:len(fileSplit)-1], ".")
for _, ext := range NODE_EXTENSIONS {
file := filepath.Join(path.ResolveRootDir(input.CfgPath), dir, base+ext)
file := filepath.Join(dir, base+ext)
if !filepath.IsAbs(file) {
file = filepath.Join(path.ResolveRootDir(input.CfgPath), file)
}
if _, err := os.Stat(file); err == nil {
return file, true
}
Expand Down
1 change: 1 addition & 0 deletions pkg/server/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type Runtime struct {
}

func (r *Runtime) Build(input *runtime.BuildInput, output *runtime.BuildOutput) error {
input.CfgPath = r.project.PathConfig()
result, err := r.project.Runtime.Build(context.Background(), input)
if err != nil {
return err
Expand Down

0 comments on commit de4b2c8

Please sign in to comment.