Unverified Commit 0d09d4a5 authored by bryanl's avatar bryanl
Browse files

Add environment path to jpath for relative imports



enviroment `main.jsonnet` files updated the path of the import of
`base.libsonnet` to remove the relative bits because you can't assume
that the environment root is directly off the root. This breaks older
applications. The fix is to add the environment path to the jpath.

Fixes #493
Signed-off-by: default avatarbryanl <bryanliles@gmail.com>
parent 02d5f89f
......@@ -99,6 +99,11 @@ func Evaluate(a app.App, envName, components, paramsStr string) (string, error)
return "", err
}
appEnv, err := a.Environment(envName)
if err != nil {
return "", err
}
snippet, err := MainFile(a, envName)
if err != nil {
return "", err
......@@ -108,6 +113,7 @@ func Evaluate(a app.App, envName, components, paramsStr string) (string, error)
vm.AddJPath(componentJPaths...)
vm.AddJPath(
filepath.Join(a.Root(), envRootName),
filepath.Join(a.Root(), envRootName, appEnv.Path),
filepath.Join(a.Root(), "vendor"),
libPath,
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment