Skip to content

Instantly share code, notes, and snippets.

@ka2n
Last active September 1, 2017 05:49
Show Gist options
  • Save ka2n/6b6e078592411e1e144d489bb3600724 to your computer and use it in GitHub Desktop.
Save ka2n/6b6e078592411e1e144d489bb3600724 to your computer and use it in GitHub Desktop.
Run command with heroku environment

$ heroku config --json { "MYSQL_URL": "mysql://foo-bar/db" }

$ hlocalrun.sh 'echo $MYSQL_URL' mysql://foo-bar/db

#!/bin/bash
heroku config --json | ruby -r json -e 'JSON.parse(STDIN.read).each {|k,v| ENV[k] = v }; exec(ARGV.join(" "))' -- $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment