Skip to content

Commit

Permalink
create cache and subdirectories writable for any user
Browse files Browse the repository at this point in the history
Signed-off-by: Stepan Blyschak <[email protected]>
  • Loading branch information
stepanblyschak committed Jul 26, 2022
1 parent bfb4a2e commit db71114
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion utilities_common/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ def __init__(self, app_name=None, tag=None):
self.cache_directory_suffix = str(self.uid) if tag is None else f"{self.uid}-{tag}"
self.cache_directory_app = os.path.join(self.CACHE_DIR, self.app_name)
self.cache_directory = os.path.join(self.cache_directory_app, self.cache_directory_suffix)
os.makedirs(self.cache_directory, exist_ok=True)
prev_umask = os.umask()
try:
os.makedirs(self.cache_directory, exist_ok=True)
finally:
os.umask(prev_umask)

def get_directory(self):
""" Return the cache directory path """
Expand Down

0 comments on commit db71114

Please sign in to comment.