From d19602145aaf8536375da0eb128c549c3481ec67 Mon Sep 17 00:00:00 2001 From: Taylor Silva Date: Fri, 2 Jul 2021 16:11:36 -0400 Subject: [PATCH] Fix path for finding file with version Signed-off-by: Taylor Silva --- cmd/out/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/out/main.go b/cmd/out/main.go index fa8419a..df8930d 100644 --- a/cmd/out/main.go +++ b/cmd/out/main.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "os" + "path/filepath" resource "github.com/concourse/mock-resource" "github.com/sirupsen/logrus" @@ -44,6 +45,7 @@ func main() { logrus.Fatal("source path is empty") return } + sourcePath := os.Args[1] if req.Source.Log != "" { logrus.Info(req.Source.Log) @@ -62,7 +64,8 @@ func main() { var version resource.Version if req.Params.Version == "" { - contents, err := os.ReadFile(req.Params.File) + path := filepath.Join(sourcePath, req.Params.File) + contents, err := os.ReadFile(path) if err != nil { logrus.Fatalf("error reading version from file %s: %s", req.Params.File, err) return