Created
November 9, 2016 14:56
-
-
Save halhenke/707fb60b504f6680da88544fc8c45131 to your computer and use it in GitHub Desktop.
Use env variables from a JSON file in Fish Shell command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function json-env -d "Takes a JSON file of config values and uses them as ENV vars for a command.. | |
e.g. json-env env.json node --inspect src/index.js" | |
eval env -S (cat $argv[1] | jq 'to_entries | reduce .[] as $item (""; . + "\($item.key)=\($item.value) ")') $argv[2..-1] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
env: invalid option -- 'S'