mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-28 02:04:07 +03:00
Fix support for existant files in git assets
This commit is contained in:
parent
3d7cd79f2d
commit
31004fc46a
|
@ -50,12 +50,17 @@ def project_assets(project_dir: Path) -> None:
|
||||||
if "git" in asset:
|
if "git" in asset:
|
||||||
if dest.exists():
|
if dest.exists():
|
||||||
# If there's already a file, check for checksum
|
# If there's already a file, check for checksum
|
||||||
if checksum and checksum == get_checksum(dest_path):
|
if checksum and checksum == get_checksum(dest):
|
||||||
msg.good(f"Skipping download with matching checksum: {dest}")
|
msg.good(f"Skipping download with matching checksum: {dest}")
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
shutil.rmtree(dest)
|
shutil.rmtree(dest)
|
||||||
git_sparse_checkout(asset["git"]["repo"], asset["git"]["path"], dest)
|
git_sparse_checkout(
|
||||||
|
asset["git"]["repo"],
|
||||||
|
asset["git"]["path"],
|
||||||
|
dest,
|
||||||
|
branch=asset["git"].get("branch", "HEAD"),
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
url = asset.get("url")
|
url = asset.get("url")
|
||||||
if not url:
|
if not url:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user