jkcfg / jk

Configuration as Code with ECMAScript
https://jkcfg.github.io
Apache License 2.0
404 stars 30 forks source link

Make files mentioned on the command line readable, even with parent paths #338

Closed squaremo closed 4 years ago

squaremo commented 4 years ago

Usually jk would forbid reading outside the input directory, but in the case of jk transform and jk validate, the files to process are given on the command line. It is a standing oddity that these commands invite arbitrary file paths, but can't actually process those outside the current directory.

This PR does a bit of rearranging, and uses the magic module facility, so that the transform and validate commands are able to read files from the real filesystem, even those with parent paths or absolute paths. This is the mechanism:

Fixes #293.