From fb7a4cab043a0cf0a116ee7b9413f358ffa45838 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Thu, 26 Jun 2014 00:14:25 +0200 Subject: [PATCH] cosmetic changes --- github-backup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/github-backup.py b/github-backup.py index a6405d0..ba80370 100755 --- a/github-backup.py +++ b/github-backup.py @@ -91,17 +91,17 @@ def process_repo(repo, args): clone_repo(repo, dir, args) else: if not args.cron: print("Repo already exists, let's try to update it instead") - - update_repo(repo, dir, args) + update_repo(repo, dir, args) def clone_repo(repo, dir, args): - url = repo.ssh_url if args.ssh else repo.git_url + params = [repo.repo.ssh_url if args.ssh else repo.git_url, dir] if args.mirror: - git("clone", ["--mirror", url, dir], args.git, dir) - else: - git("clone", [url, dir], args.git, dir) + params.insert(0, ["--mirror"]) + + git("clone", params, args.git, dir) + def update_repo(repo, dir, args): # GitHub => Local @@ -126,12 +126,12 @@ def git(gcmd, args=[], gargs=[], gdir=""): if gdir: cmd.append("--git-dir") cmd.append(gdir) + cmd.append(gcmd) cmd.extend(gargs) cmd.extend(args) subprocess.call(cmd) ->>>>>>> replaced os.system() by subprocess.call() and fixed escaping errors if __name__ == "__main__": main()