Skip to content

Instantly share code, notes, and snippets.

@halhenke
Created November 9, 2016 14:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halhenke/707fb60b504f6680da88544fc8c45131 to your computer and use it in GitHub Desktop.
Save halhenke/707fb60b504f6680da88544fc8c45131 to your computer and use it in GitHub Desktop.
Use env variables from a JSON file in Fish Shell command
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
@EnverOsmanov
Copy link

env: invalid option -- 'S'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment