Skip to content

Commit 0fc9166

Browse files
committed
resolve path/dir for filename late
1 parent 283493c commit 0fc9166

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pkg/jsonnet/eval.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package jsonnet
22

33
import (
4-
"path/filepath"
5-
64
jsonnet "github.com/google/go-jsonnet"
75
"github.com/pkg/errors"
86

@@ -60,7 +58,7 @@ func MakeVM(opts Opts) *jsonnet.VM {
6058
// result in JSON form. It disregards opts.ImportPaths in favor of automatically
6159
// resolving these according to the specified file.
6260
func EvaluateFile(jsonnetFile string, opts Opts) (string, error) {
63-
jpath, _, _, err := jpath.Resolve(filepath.Dir(jsonnetFile))
61+
jpath, _, _, err := jpath.Resolve(jsonnetFile)
6462
if err != nil {
6563
return "", errors.Wrap(err, "resolving import paths")
6664
}
@@ -72,7 +70,7 @@ func EvaluateFile(jsonnetFile string, opts Opts) (string, error) {
7270

7371
// Evaluate renders the given jsonnet into a string
7472
func Evaluate(filename, data string, opts Opts) (string, error) {
75-
jpath, _, _, err := jpath.Resolve(filepath.Dir(filename))
73+
jpath, _, _, err := jpath.Resolve(filename)
7674
if err != nil {
7775
return "", errors.Wrap(err, "resolving import paths")
7876
}

0 commit comments

Comments
 (0)