mirror of
https://github.com/kennethreitz/ghsync.git
synced 2026-06-05 23:10:16 +00:00
ENV configs for dir
This commit is contained in:
+7
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user