Open
Description
Story
Not a use case.
But just as a jsonnet starter, wonder what is I set output key begins with "/" and "..".
Seems there are two different logic.
- "/" is chroot-jail alike
- ".." is NOT chroot-jail alike
Don't know if it is a bug or a feature. So here I am.
Reproduce
$ cat foo.jsonnet
{
"a.json": {
"a": 42
},
"/tmp/b.json": {
"a": 42
},
"../c.json": {
"a": 42
}
}
Actual
'../c.json' is outside of 'dist'
$ jsonnet -c -m dist foo.jsonnet
dist/../c.json
dist//tmp/b.json
dist/a.json
$ tree
.
├── c.json
├── dist
│ ├── a.json
│ └── tmp
│ └── b.json
└── foo.jsonnet
Expected
'../c.json' is within of 'dist'
$ jsonnet -c -m dist foo.jsonnet
dist/c.json
dist//tmp/b.json
dist/a.json
$ tree
.
├── dist
│ ├── c.json
│ ├── a.json
│ └── tmp
│ └── b.json
└── foo.jsonnet