Skip to content

Instantly share code, notes, and snippets.

@ys
Last active August 29, 2015 13:55
Show Gist options
  • Save ys/8782690 to your computer and use it in GitHub Desktop.
Save ys/8782690 to your computer and use it in GitHub Desktop.
Having multiple Heroku accounts? Switch between multiple netrc files!
//USAGE: _hk <alternate netrc file extension> <hk parameters>
function _hk {
altfile=$1
shift;
mv ~/.netrc ~/.netrc.bckp
mv ~/.netrc.$altfile ~/.netrc
hk $@
mv ~/.netrc ~/.netrc.$altfile
mv ~/.netrc.bckp ~/.netrc
}
// NEW version thanks to @franckverrot
// https://coderwall.com/p/q_ickw
function _hk {
altfile=$1
shift;
HOME=~/.ssh/heroku-$altfile hk $@
}
@kcroker
Copy link

kcroker commented Jun 14, 2015

brilliant xD

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