Skip to content

Commit

Permalink
cache
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin authored Dec 2, 2024
1 parent c80d2ec commit 9be5d5e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nameisok/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ def warn(msg):

def get_cache_file(name='names_cache_') -> Path:
if os.name == 'posix':
cache_dir = Path.home() / '.cache' / PACKAGE_NAME # Linux/macOS: ~/.cache/nameisok
cache_dir = Path.home() / '.cache' / PACKAGE_NAME
elif os.name == 'nt':
cache_dir = Path(os.getenv('LOCALAPPDATA',
Path.home() / 'AppData' / 'Local')) / PACKAGE_NAME # Windows: %LOCALAPPDATA%\nameisok
Path.home() / 'AppData' / 'Local')) / PACKAGE_NAME
else:
cache_dir = Path.home() / '.cache' / PACKAGE_NAME # Default to Linux-style cache path
cache_dir = Path.home() / '.cache' / PACKAGE_NAME

cache_dir.mkdir(parents=True, exist_ok=True) # Create the directory if it doesn't exist
cache_dir.mkdir(parents=True, exist_ok=True)
return cache_dir / f'{name}.txt'


Expand Down

0 comments on commit 9be5d5e

Please sign in to comment.