cf-vault icon indicating copy to clipboard operation
cf-vault copied to clipboard

Variable substitution doesn't work in `exec` commands

Open jacobbednarz opened this issue 3 years ago • 1 comments

One use case for this tool is to be able to run a one off command referencing the variables.

cf-vault exec test -v -- curl -sv -H "X-Auth-Key: $CLOUDFLARE_API_KEY" https://api.cloudflare.com/...

However, the variable substitution is attempting to happen before the new process is spawned resulting in the value being empty and the resulting command being:

curl -sv -H X-Auth-Key:  https://api.cloudflare.com/...

jacobbednarz avatar Sep 16 '20 23:09 jacobbednarz

confirmed this has been fixed somewhere between opening this and 0.0.8. the following now works

cf-vault exec [profile-name] -- echo $CLOUDFLARE_API_TOKEN

jacobbednarz avatar Nov 24 '20 03:11 jacobbednarz