Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Exit gracefully if git fails. #3

Merged
merged 1 commit into from

2 participants

@nuoyan

r+

@davedash davedash merged commit 978ef1d into pinterest:master

1 check passed

Details default The Travis CI build passed
@davedash davedash deleted the davedash:exit-gracefully branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 24, 2013
  1. Exit gracefully if git fails.

    Dave Dash authored
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 2 deletions.
  1. +1 −1  setup.py
  2. +7 −1 wheeljack/install.py
View
2  setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
import os
-__version__ = '0.1'
+__version__ = '0.2'
markdown_contents = open(os.path.join(os.path.dirname(__file__),
'README.md')).read()
View
8 wheeljack/install.py
@@ -22,7 +22,12 @@ def __git_command(url):
Returns newly created directory.
"""
dir_ = get_code_dir(url)
- subprocess.check_call(('git', 'clone', url, dir_))
+ args = ('git', 'clone', url, dir_)
+ try:
+ subprocess.check_call(args)
+ except subprocess.CalledProcessError:
+ cmd = ' '.join(args)
+ exit("I had trouble calling the following command:\n {}".format(cmd))
return dir_
@@ -37,6 +42,7 @@ def _install_repo(repo, config=None, git_command=None):
if not git_command:
git_command = __git_command
+
url = data['url']
code_dir = get_code_dir(url)
if os.path.exists(code_dir):
Something went wrong with that request. Please try again.