Files
zulip/scripts/lib/clean_unused_caches.py
Riken Shah 45af71e33b clean_unused_caches: Allow the main function to accept Namespace args.
This commit will allow us to pass the arguments in the
'clean...' functions when calling the `main` function (in
`provision`). It also changes args parsing
function location to `if __name__ == "__main__"` block as
we wouldn't need it to parse args when we call the
function.
2021-06-12 07:28:16 -07:00

23 lines
657 B
Python
Executable File

#!/usr/bin/env python3
import argparse
import os
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scripts.lib import clean_emoji_cache, clean_node_cache, clean_venv_cache, clean_yarn_cache
from scripts.lib.zulip_tools import parse_cache_script_args
def main(args: argparse.Namespace) -> None:
os.chdir(ZULIP_PATH)
clean_venv_cache.main(args)
clean_node_cache.main(args)
clean_yarn_cache.main(args)
clean_emoji_cache.main(args)
if __name__ == "__main__":
args = parse_cache_script_args("This script cleans unused Zulip caches.")
main(args)