Created
August 14, 2015 18:43
-
-
Save btoews/b07c3e6a2a9d9b795848 to your computer and use it in GitHub Desktop.
Store GitHub access token in keychain
This file contains hidden or 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
#!/bin/bash | |
echo -n "GitHub username: " | |
read username | |
echo -n "GitHub personal access token: " | |
read token | |
echo "Storing GitHub access token in keychain." | |
security add-generic-password -s github_access_token -a $username -w $token | |
echo "Configuring your .profile to get your access token from the keychain and put it in the \$GITHUB_ACCESS_TOKEN variable" | |
echo "export GITHUB_ACCESS_TOKEN=\$(security find-generic-password -s github_access_token -a $username -w)" >> ~/.profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment