From ed576e5e0e8430d3f0617eac15d2d8113bd8b44d Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Fri, 5 Aug 2016 18:43:33 -0700 Subject: [PATCH] fix dumb mistake due to reuse of 'path' --- README.md | 2 +- wp2git/version.py | 2 +- wp2git/wp2git.py | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index b7cebf9..2bf92dd 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This program allows you to download and convert any Wikipedia article's history ### Quick installation ``` -pip install https://github.com/dlenski/wp2git/archive/v1.0.zip +pip install https://github.com/dlenski/wp2git/archive/v1.0.1.zip ``` ### Usage diff --git a/wp2git/version.py b/wp2git/version.py index 9aca18b..611efb7 100644 --- a/wp2git/version.py +++ b/wp2git/version.py @@ -1,3 +1,3 @@ # Do not edit this file, wp2git versioning is governed by git tags -__version__="1.0" +__version__="1.0.1" diff --git a/wp2git/wp2git.py b/wp2git/wp2git.py index 15a895d..1c02be8 100755 --- a/wp2git/wp2git.py +++ b/wp2git/wp2git.py @@ -74,17 +74,16 @@ def main(): if args.doimport: # Create output directory and pipe to git if args.out is not None: - path = args.out + out = args.out else: - path = fn + out = fn - if os.path.exists(path): - p.error('path %s exists' % path) + if os.path.exists(out): + p.error('path %s exists' % out) else: - os.mkdir(path) - os.chdir(path) - sp.check_call(['git','init'] + (['--bare'] if args.bare else [])) - pipe = sp.Popen(['git', 'fast-import','--quiet','--done'], stdin=sp.PIPE) + os.mkdir(out) + sp.check_call(['git','init'] + (['--bare'] if args.bare else []), cwd=out) + pipe = sp.Popen(['git', 'fast-import','--quiet','--done'], stdin=sp.PIPE, cwd=out) fid = pipe.stdin else: fid = args.out @@ -125,7 +124,7 @@ def main(): if args.doimport: pipe.communicate() if not args.bare: - sp.check_call(['git','checkout']) + sp.check_call(['git','checkout'], cwd=out) if __name__=='__main__': main()