mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Handle already-present directories for git assets
This commit is contained in:
parent
4dae195431
commit
a06a7f1f05
|
@ -48,7 +48,13 @@ def project_assets(project_dir: Path) -> None:
|
||||||
dest = Path(asset["dest"])
|
dest = Path(asset["dest"])
|
||||||
checksum = asset.get("checksum")
|
checksum = asset.get("checksum")
|
||||||
if "git" in asset:
|
if "git" in asset:
|
||||||
print(dest)
|
if dest.exists():
|
||||||
|
# If there's already a file, check for checksum
|
||||||
|
if checksum and checksum == get_checksum(dest_path):
|
||||||
|
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)
|
||||||
else:
|
else:
|
||||||
url = asset.get("url")
|
url = asset.get("url")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user