Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
clean-unused-caches: Handle non-existent yarn cache.
Robert Imschweilerba25580b19dc
diff --git a/scripts/lib/clean_yarn_cache.py b/scripts/lib/clean_yarn_cache.pyindex 2383859e8c2..1cc2687e055 100644--- a/scripts/lib/clean_yarn_cache.py+++ b/scripts/lib/clean_yarn_cache.py@@ -20,13 +20,16 @@ def remove_unused_versions_dir(args: argparse.Namespace) -> None:can always remove the cache entirely."""current_version_dir = os.path.join(YARN_CACHE_PATH, CURRENT_VERSION)- dirs_to_purge = set(- [- os.path.join(YARN_CACHE_PATH, directory)- for directory in os.listdir(YARN_CACHE_PATH)- if directory != CURRENT_VERSION- ]- )+ try:+ dirs_to_purge = set(+ [+ os.path.join(YARN_CACHE_PATH, directory)+ for directory in os.listdir(YARN_CACHE_PATH)+ if directory != CURRENT_VERSION+ ]+ )+ except FileNotFoundError:+ returnmay_be_perform_purging(dirs_to_purge,