Files
zulip/scripts/clean-unused-caches
Harshit Bansal 7f752f0942 scripts: Use parse_cache_script_args() in various cache cleaning scripts.
Instead of using `GENERIC_CACHE_SCRIPT_PARSER` and defining `parse_args()`
function in each script separately, use `parse_cache_script_args()`.
2017-09-24 04:37:31 -07:00

22 lines
707 B
Python
Executable File

#!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(ZULIP_PATH)
from scripts.lib.zulip_tools import get_environment, parse_cache_script_args
def main():
# type: () -> None
parse_cache_script_args("This script cleans unused zulip caches.")
os.chdir(ZULIP_PATH)
print("Starting cache cleaning scripts...")
subprocess.check_call(["./scripts/lib/clean-venv-cache"] + sys.argv[1:])
subprocess.check_call(["./scripts/lib/clean-npm-cache"] + sys.argv[1:])
subprocess.check_call(["./scripts/lib/clean-emoji-cache"] + sys.argv[1:])
if __name__ == "__main__":
main()