Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bin/github-backup
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import urllib2

from github_backup import __version__

FNULL = open(os.devnull, 'w')

def log_error(message):
if type(message) == str:
Expand Down Expand Up @@ -357,6 +358,11 @@ def fetch_repository(name, remote_url, local_dir, skip_existing=False):
if clone_exists and skip_existing:
return

initalized = subprocess.call('git ls-remote ' + remote_url, stdout=FNULL, stderr=FNULL, shell=True)
if initalized == 128:
log_info("Skipping {} since it's not initalized".format(name))
return

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appears indent went wrong... I'll create an update.

if clone_exists:
log_info('Updating {} in {}'.format(name, local_dir))
git_command = ['git', 'fetch', '--all', '--tags', '--prune']
Expand Down