You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the same with the -J or --jpath argument does not work:
jsonnet --jpath $(pwd)/vendor1:$(pwd)/vendor2 -e "(importstr 'lib1/shared1.txt')+(importstr 'lib2/shared2.txt')"
RUNTIME ERROR: couldn't open import "lib1/shared1.txt": no match locally or in the Jsonnet library paths
<cmdline>:1:2-30 $
During evaluation
@skuzzle you can specify the option multiple times like jsonnet -J $(pwd)/vendor1 -J $(pwd)/vendor2, in case the file is present in multiple directories the last one wins.
Issuing jsonnet --help prints an example of how JSONNET_PATH env variable and -J options interact together
Environment variables:
JSONNET_PATH is a colon (semicolon on Windows) separated list of directories
added in reverse order before the paths specified by --jpath (i.e. left-most
wins). E.g. these are equivalent:
JSONNET_PATH=a:b jsonnet -J c -J d
JSONNET_PATH=d:c:a:b jsonnet
jsonnet -J b -J a -J c -J d
Oh, not sure how I could miss that. Thanks for pointing this out. Anyway, I wonder whether there'd be some value in -J accepting multiples paths in a single parameter? To me this would at least feel a bit more consistent if -J and JSONNET_PATH accepted the same values
Hi,
I was surprised by this behavior, also the console help text is not very precise regarding whether multiple search paths are even allowed or not.
Given the following directory structure:
Passing multiple library directories via
JSONNET_PATH
seems to work as expected, properly resolving files from both library locations:However, the same with the
-J
or--jpath
argument does not work:Tested with
Quick reproducer project with the example from above can be found here: https://github.com/skuzzle/jpath-issue-reproducer
The text was updated successfully, but these errors were encountered: