A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324
  1. #! /usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from __future__ import print_function
  4. import os
  5. import subprocess
  6. def process(*args):
  7. print(*args)
  8. content = subprocess.check_output(args)
  9. def main():
  10. root = os.path.join(os.path.dirname(__file__), "static")
  11. for dirpath, dirnames, filenames in os.walk(root):
  12. for filename in filenames:
  13. name = os.path.relpath(os.path.join(dirpath, filename))
  14. if filename.endswith(".js") and ".min." not in filename:
  15. process("uglifyjs", "--compress", "-o", name.replace(".js", ".min.js"), "--", name)
  16. if filename.endswith(".css") and ".min." not in filename:
  17. process("postcss", "-u", "cssnano", "--no-map", name, "-o",
  18. name.replace(".css", ".min.css"))
  19. if __name__ == "__main__":
  20. main()