fix dumb mistake due to reuse of 'path'

This commit is contained in:
Daniel Lenski 2016-08-05 18:43:33 -07:00
parent 594cd52955
commit ed576e5e0e
3 changed files with 10 additions and 11 deletions

View File

@ -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

View File

@ -1,3 +1,3 @@
# Do not edit this file, wp2git versioning is governed by git tags
__version__="1.0"
__version__="1.0.1"

View File

@ -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()