ENV configs for dir

This commit is contained in:
Kenneth Reitz
2011-02-20 21:32:33 -05:00
parent f6d4d7ac6c
commit 27a0037832
+7 -1
View File
@@ -22,6 +22,7 @@ Inspired by Gisty (http://github.com/swdyh/gisty).
"""
import os
import sys
from commands import getoutput as cmd
from github2.client import Github
@@ -36,9 +37,14 @@ __version__ = '0.2'
GITHUB_USER = cmd('git config github.user')
GITHUB_TOKEN = cmd('git config github.token')
GHSYNC_DIR = os.environ.get('GHSYNC_DIR', '.')
def run():
os.chdir(GHSYNC_DIR)
# API Object
github = Github(username=GITHUB_USER, api_token=GITHUB_TOKEN)
@@ -100,4 +106,4 @@ def run():
print
if __name__ == '__main__':
run()
run()