A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build.py 841 B

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()