Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Prepare for 4.1.3
Browse files Browse the repository at this point in the history
Fix planex-clone issue where we couldn't clone certain pins due to path
issues, as well as files being treated as archives.
  • Loading branch information
samuelconnolly committed Jan 30, 2019
1 parent c437264 commit b70128f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions planex/cmd/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ def clone(url, destination, commitish):

if not destination.parent.exists():
destination.parent.mkdir(parents=True)
if destination.exists():
# Take a fresh clone if we are re-cloning
shutil.rmtree(str(destination))

repo = git.Repo.clone_from(url, str(destination))
if commitish in repo.remotes['origin'].refs:
Expand Down Expand Up @@ -191,7 +194,7 @@ def extract(url_str, destination):
archive_file = None

# pylint: disable=no-member
destination.mkdir(parents=True)
destination.mkdir(parents=True, exist_ok=True)
repo = git.Repo.init(str(destination))

logging.debug("Extracting %s to new git repo", url_str)
Expand All @@ -216,9 +219,10 @@ def extract(url_str, destination):
fetch_url(url, archive_path, 5)

# extract the archive
tara = tarfile.open(archive_path)
tara.extractall(str(destination))
tara.close()
if tarfile.is_tarfile(archive_path):
tara = tarfile.open(archive_path)
tara.extractall(str(destination))
tara.close()

if archive_file:
# delete temp file
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup

setup(name='planex',
version='4.1.2',
version='4.1.3',
packages=['planex', 'planex.cmd'],
package_data={'planex': ['Makefile.rules']},
entry_points={
Expand Down

0 comments on commit b70128f

Please sign in to comment.