Skip to content

Commit

Permalink
Create brainglobe dir if none present during get_atlases_lastversions…
Browse files Browse the repository at this point in the history
… call (#402)
  • Loading branch information
IgorTatarnikov authored Sep 3, 2024
1 parent 4332403 commit 414b0fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions brainglobe_atlasapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def conf_from_url(url) -> configparser.ConfigParser:
config_obj.read_string(text)
cache_path = config.get_brainglobe_dir() / "last_versions.conf"

if not cache_path.parent.exists():
cache_path.parent.mkdir(parents=True, exist_ok=True)

# Cache the available atlases
with open(cache_path, "w") as f_out:
config_obj.write(f_out)
Expand Down

0 comments on commit 414b0fa

Please sign in to comment.