diff --git a/ghsync/core.py b/ghsync/core.py index 61b9458..6624ccf 100644 --- a/ghsync/core.py +++ b/ghsync/core.py @@ -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() \ No newline at end of file + run()