1
1
package jsonnet
2
2
3
3
import (
4
- "path/filepath"
5
-
6
4
jsonnet "github.com/google/go-jsonnet"
7
5
"github.com/pkg/errors"
8
6
@@ -60,7 +58,7 @@ func MakeVM(opts Opts) *jsonnet.VM {
60
58
// result in JSON form. It disregards opts.ImportPaths in favor of automatically
61
59
// resolving these according to the specified file.
62
60
func EvaluateFile (jsonnetFile string , opts Opts ) (string , error ) {
63
- jpath , _ , _ , err := jpath .Resolve (filepath . Dir ( jsonnetFile ) )
61
+ jpath , _ , _ , err := jpath .Resolve (jsonnetFile )
64
62
if err != nil {
65
63
return "" , errors .Wrap (err , "resolving import paths" )
66
64
}
@@ -72,7 +70,7 @@ func EvaluateFile(jsonnetFile string, opts Opts) (string, error) {
72
70
73
71
// Evaluate renders the given jsonnet into a string
74
72
func Evaluate (filename , data string , opts Opts ) (string , error ) {
75
- jpath , _ , _ , err := jpath .Resolve (filepath . Dir ( filename ) )
73
+ jpath , _ , _ , err := jpath .Resolve (filename )
76
74
if err != nil {
77
75
return "" , errors .Wrap (err , "resolving import paths" )
78
76
}
0 commit comments