Skip to content

Commit

Permalink
Capture errors in calls. Commit if merging.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 26, 2022
1 parent 7ab447f commit 911e679
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions jaraco/develop/update-projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@ def checkout(project):
with path.TempDir() as dir:
repo = dir / 'repo'
repo.mkdir()
subprocess.Popen(['git', 'clone', url, repo]).wait()
subprocess.check_call(['git', 'clone', url, repo])
with repo:
yield


def update_project(name):
resolved = resolve(name)
print('\nupdating', name)
with checkout(resolved):
subprocess.Popen(['git', 'pull', 'gh://jaraco/skeleton']).wait()
subprocess.Popen(['git', 'mergetool']).wait()
subprocess.Popen(['git', 'push']).wait()
proc = subprocess.Popen(['git', 'pull', 'gh://jaraco/skeleton'])
code = proc.wait()
if code:
subprocess.check_call(['git', 'mergetool'])
subprocess.check_call(['git', 'commit', '--no-edit'])
subprocess.check_call(['git', 'push'])


@autocommand.autocommand(__name__)
Expand Down

0 comments on commit 911e679

Please sign in to comment.