File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from time import time
1010from typing import Generator
1111from datetime import datetime , timedelta
12- from platformdirs import user_data_dir
1312
13+ from platformdirs import user_cache_dir
1414import niquests
1515from tqdm import tqdm
1616
2323
2424
2525def main () -> int :
26- bin_dir_path = Path (user_data_dir ("pytailwindcss-extra" )) / "bin"
26+ bin_dir_path = Path (user_cache_dir ("pytailwindcss-extra" )) / "bin"
2727
28- cache_file_path = Path (gettempdir ( )) / "tailwindcss-extra-cache .json"
28+ cache_file_path = Path (user_cache_dir ( "pytailwindcss-extra" )) / "versions .json"
2929 version = get_version (environ .get ("PYTAILWINDCSS_EXTRA_VERSION" , "major" ), cache_file_path )
3030
3131 bin_path = bin_dir_path / f"tailwindcss-extra-{ version .replace ('.' , '-' )} "
@@ -77,6 +77,7 @@ def get_cached_version(key: str, cache_file_path: Path) -> str | None:
7777
7878def set_cached_version (key : str , version : str , cache_file_path : Path ) -> None :
7979 if not cache_file_path .exists ():
80+ cache_file_path .parent .mkdir (parents = True , exist_ok = True )
8081 with cache_file_path .open ("w" ) as file :
8182 file .write ("{}" )
8283
You can’t perform that action at this time.
0 commit comments