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 ### 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 ### Usage

View File

@ -1,3 +1,3 @@
# Do not edit this file, wp2git versioning is governed by git tags # 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: if args.doimport:
# Create output directory and pipe to git # Create output directory and pipe to git
if args.out is not None: if args.out is not None:
path = args.out out = args.out
else: else:
path = fn out = fn
if os.path.exists(path): if os.path.exists(out):
p.error('path %s exists' % path) p.error('path %s exists' % out)
else: else:
os.mkdir(path) os.mkdir(out)
os.chdir(path) sp.check_call(['git','init'] + (['--bare'] if args.bare else []), cwd=out)
sp.check_call(['git','init'] + (['--bare'] if args.bare else [])) pipe = sp.Popen(['git', 'fast-import','--quiet','--done'], stdin=sp.PIPE, cwd=out)
pipe = sp.Popen(['git', 'fast-import','--quiet','--done'], stdin=sp.PIPE)
fid = pipe.stdin fid = pipe.stdin
else: else:
fid = args.out fid = args.out
@ -125,7 +124,7 @@ def main():
if args.doimport: if args.doimport:
pipe.communicate() pipe.communicate()
if not args.bare: if not args.bare:
sp.check_call(['git','checkout']) sp.check_call(['git','checkout'], cwd=out)
if __name__=='__main__': if __name__=='__main__':
main() main()