diff --git a/nlmod/util.py b/nlmod/util.py index 914d7199..7699b3f2 100644 --- a/nlmod/util.py +++ b/nlmod/util.py @@ -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)