Last active
August 29, 2015 13:55
-
-
Save ys/8782690 to your computer and use it in GitHub Desktop.
Having multiple Heroku accounts? Switch between multiple netrc files!
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
//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 $@ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
brilliant xD