A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

40 lines
1.0 KiB

  1. #! /usr/bin/env python
  2. import os
  3. import subprocess
  4. def process(*args):
  5. print(*args)
  6. subprocess.run(args, check=True)
  7. def main():
  8. root = os.path.join(os.path.dirname(__file__), "static")
  9. for dirpath, dirnames, filenames in os.walk(root):
  10. for filename in filenames:
  11. name = os.path.relpath(os.path.join(dirpath, filename))
  12. if filename.endswith(".js") and ".min." not in filename:
  13. process(
  14. "uglifyjs",
  15. "--compress",
  16. "-o",
  17. name.replace(".js", ".min.js"),
  18. "--",
  19. name,
  20. )
  21. if filename.endswith(".css") and ".min." not in filename:
  22. process(
  23. "postcss",
  24. "-u",
  25. "cssnano",
  26. "--no-map",
  27. name,
  28. "-o",
  29. name.replace(".css", ".min.css"),
  30. )
  31. if __name__ == "__main__":
  32. main()