mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +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 dest.exists():
|
||||
# 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}")
|
||||
continue
|
||||
else:
|
||||
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:
|
||||
url = asset.get("url")
|
||||
if not url:
|
||||
|
|
Loading…
Reference in New Issue
Block a user