Created
August 7, 2014 09:30
-
-
Save klmr/3840aa3c12f947e4064c to your computer and use it in GitHub Desktop.
Grip settings file for OS X, which retrieves the GitHub password from “Keychain Access.app”
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
def find_password(): | |
import subprocess | |
import re | |
cmd = ['security', 'find-internet-password', '-gs', 'github.com'] | |
pwinfo = subprocess.Popen(cmd, stdout = subprocess.PIPE, | |
stderr = subprocess.PIPE) | |
pwline = pwinfo.stderr.read().strip() | |
return re.sub('password: "(.*)"', '\\1', pwline) | |
PASSWORD = find_password() | |
USERNAME = '<github_user_name>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment