mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +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"])
|
||||
checksum = asset.get("checksum")
|
||||
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)
|
||||
else:
|
||||
url = asset.get("url")
|
||||
|
|
Loading…
Reference in New Issue
Block a user