Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Fix repos creation and exit when a command fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Feb 22, 2013
1 parent 9625509 commit 40f0a25
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/zope/githubsupport/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def do(cmd, cwd=None):
out, _ = p.communicate()
if out:
print(out.decode())
if p.returncode != 0:
sys.exit(p.returncode)


def svn2git(target_path, config, options):
Expand Down Expand Up @@ -119,7 +121,8 @@ def update_winegg(config, options):

def migrate_package(config, options):
if options.create_repos:
repos.addrepos(options.orig_args)
gh = repos.get_github(options)
repos.add_repository(gh, config, options)
git_path = options.git_path
if git_path is None:
git_path = tempfile.mkdtemp()
Expand Down Expand Up @@ -157,7 +160,7 @@ def get_options(parser, args=None, defaults=None):
parser = optparse.OptionParser("%prog [options] REPOS [DESC]")

config = optparse.OptionGroup(
parser, "Configuration", "Options that deal with configuring the browser.")
parser, "Configuration", "Options that deal with migration.")

config.add_option(
'--create', '-C', action="store_true", dest='create_repos', default=False,
Expand Down

0 comments on commit 40f0a25

Please sign in to comment.