Skip to content

Commit

Permalink
Fixed a bug that was causing the docs to exit when they were being bu…
Browse files Browse the repository at this point in the history
…ilt.
  • Loading branch information
asoderman committed Jan 8, 2018
1 parent 7e6dce9 commit 97fa048
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docCLI/google.py
Expand Up @@ -12,13 +12,14 @@ class NoClientSecretException(Exception):

SCOPES = 'https://www.googleapis.com/auth/drive'

try:
CLIENT_SECRET_FILE = 'docCLI/credentials/client_secret.json'
if not os.path.isfile(CLIENT_SECRET_FILE):
raise NoClientSecretException()
except NoClientSecretException:
print('Unable to find client secret. Exiting...')
sys.exit(1)
def get_client_secret():
try:
CLIENT_SECRET_FILE = 'docCLI/credentials/client_secret.json'
if not os.path.isfile(CLIENT_SECRET_FILE):
raise NoClientSecretException()
except NoClientSecretException:
print('Unable to find client secret. Exiting...')
sys.exit(1)


APPLICATION_NAME = 'docCLI'
Expand All @@ -32,6 +33,7 @@ def get_credentials():
Returns:
Credentials, the obtained credential.
'''
CLIENT_SECRET_FILE = get_client_secret()
home_dir = os.path.expanduser('~')
credential_dir = os.path.join(home_dir, '.credentials')
if not os.path.exists(credential_dir):
Expand Down

0 comments on commit 97fa048

Please sign in to comment.