Skip to content

Commit d196021

Browse files
committed
Fix path for finding file with version
Signed-off-by: Taylor Silva <[email protected]>
1 parent 8a49dd1 commit d196021

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/out/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"encoding/json"
55
"os"
6+
"path/filepath"
67

78
resource "github.com/concourse/mock-resource"
89
"github.com/sirupsen/logrus"
@@ -44,6 +45,7 @@ func main() {
4445
logrus.Fatal("source path is empty")
4546
return
4647
}
48+
sourcePath := os.Args[1]
4749

4850
if req.Source.Log != "" {
4951
logrus.Info(req.Source.Log)
@@ -62,7 +64,8 @@ func main() {
6264

6365
var version resource.Version
6466
if req.Params.Version == "" {
65-
contents, err := os.ReadFile(req.Params.File)
67+
path := filepath.Join(sourcePath, req.Params.File)
68+
contents, err := os.ReadFile(path)
6669
if err != nil {
6770
logrus.Fatalf("error reading version from file %s: %s", req.Params.File, err)
6871
return

0 commit comments

Comments
 (0)