Closed rolfen closed 5 years ago
Hi @rolfen, thanks for the bug report!
The issue here is because the -d
option will only apply to the files in the crossplane JSON that use relative paths. If you pipe the parsed config file into the build command, you'll always write to /etc/nginx/nginx.conf because the absolute path is stored in the JSON.
I can see why that'd be confusing. We'll consider editing the help message and README.
Hi!
Oh, OK! Thank you for the prompt clarification, it makes sense.
I am closing the issue, because the issue strictly as described is resolved.
However a note in the documentation would be very welcome.
Feel free to reopen it if you prefer.
I was trying to build config files into a temporary directory so that I can examine them. To achieve my intentions, I had to rewrite absolute paths because crossplane would not override them.
mkdir /tmp/nginx.conf/
crossplane parse /etc/nginx/nginx.conf |sed s:\"/etc/nginx/:\"/tmp/nginx.conf/:g |crossplane build /dev/stdin
Describe the bug The documentation for the
build
command describes:-d PATH, --dir PATH the base directory to build in
However, in practice, this does not produce the expected effect.To Reproduce
crossplane parse /etc/nginx/nginx.conf |crossplane build -d /tmp /dev/stdin
Expected behavior crossplane produces new configuration files inside the
/tmp
directory as instructed by the-d
optionActual behavior crossplane tries to overwrite the configuration files in
/etc/nginx
Your environment