I'm trying to set up the
gist gem, but I don't want to have my GitHub password stored as an environment variable or git config item. The README from the GitHub repo explains,
You can also define github.password to be a command which returns the actual password on stdout by setting the variable to a command string prefixed with
The problem I'm having is figuring out where to put the described function. Any tips?
Here's the function described in the above link (fetches github.password item from Mac OS Keychain):
password = !security 2>&1 >/dev/null find-generic-password -gs github.password | ruby -e 'print $1 if STDIN.gets =~ /^password: \\\"(.*)\\\"$/'