Skip to content

Commit

Permalink
Write metadata in case metadata is not written
Browse files Browse the repository at this point in the history
  • Loading branch information
bdestombe committed Jun 24, 2024
1 parent 1fca2b7 commit 3024960
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nlmod/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,17 @@ def download_mfbinaries(bindir=None, version_tag="latest", repo="executables"):

get_modflow(bindir=str(bindir), release_id=version_tag, repo=repo)

# Ensure metadata is saved.
# https://github.com/modflowpy/flopy/blob/
# 0748dcb9e4641b5ad9616af115dd3be906f98f50/flopy/utils/get_modflow.py#L623
flopy_metadata_fp = flopy_appdata_path / "get_modflow.json"
if not flopy_metadata_fp.exists():
meta = get_release(tag=version_tag, repo=repo, quiet=True)
meta["bindir"] = str(bindir)

with open(flopy_metadata_fp, "w") as f:
json.dump([meta], f, indent=4)

# download the provisional version of modpath from Github
download_modpath_provisional_exe(bindir=bindir, timeout=120)

Expand Down

0 comments on commit 3024960

Please sign in to comment.