From c8cb9b4bdfd3d30cffad603ef94dd07aa5b8ab08 Mon Sep 17 00:00:00 2001 From: Doug Turner Date: Sun, 18 Aug 2013 22:29:41 -0700 Subject: [PATCH] update_repo must use os.chdir(). calling os.system(cd --- github-backup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/github-backup.py b/github-backup.py index a6ccec3..4351438 100755 --- a/github-backup.py +++ b/github-backup.py @@ -71,7 +71,8 @@ def clone_repo(repo, dir, args): def update_repo(repo, dir, args): - os.system("cd %s"%(dir,)) + savedPath = os.getcwd() + os.chdir(dir) # GitHub => Local if args.mirror: @@ -80,6 +81,7 @@ def update_repo(repo, dir, args): else: os.system("git pull %s"%(args.git,)) + os.chdir(savedPath) if __name__ == "__main__": main()