2017-08-22 00:18:59 +02:00
|
|
|
#!/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 GENERIC_CACHE_SCRIPT_PARSER, \
|
|
|
|
get_environment
|
|
|
|
|
|
|
|
def parse_args():
|
|
|
|
# type: () -> argparse.Namespace
|
|
|
|
parser = argparse.ArgumentParser(description="This script cleans unused zulip caches.",
|
|
|
|
parents=[GENERIC_CACHE_SCRIPT_PARSER, ])
|
|
|
|
args = parser.parse_args()
|
|
|
|
return args
|
|
|
|
|
|
|
|
def main():
|
|
|
|
# type: () -> None
|
|
|
|
parse_args()
|
|
|
|
os.chdir(ZULIP_PATH)
|
|
|
|
print("Starting cache cleaning scripts...")
|
2017-08-28 02:59:49 +02:00
|
|
|
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:])
|
2017-08-22 00:18:59 +02:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|