Skip to content

Commit

Permalink
Backport check for empty runtime directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashton Meuser authored and Ashton Meuser committed May 30, 2024
1 parent 3ba456d commit 208a8c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _patch_dll_import():

def download_wasmer(env, force=False, version=WASMER_VER_DEFAULT):
_validate_version(version)
if not force and os.path.isdir("wasmer"):
if not force and os.path.isdir("wasmer") and len(os.listdir("wasmer")):
return # Skip download
print("Downloading Wasmer library {}".format(version))
shutil.rmtree("wasmer", True) # Remove old library
Expand Down Expand Up @@ -111,7 +111,7 @@ def download_wasmer(env, force=False, version=WASMER_VER_DEFAULT):

def download_wasmtime(env, force=False, version=WASMTIME_VER_DEFAULT):
_validate_version(version)
if not force and os.path.isdir("wasmtime"):
if not force and os.path.isdir("wasmtime") and len(os.listdir("wasmtime")):
return # Skip download
print("Downloading Wasmtime library {}".format(version))
shutil.rmtree("wasmtime", True) # Remove old library
Expand Down

0 comments on commit 208a8c6

Please sign in to comment.