Advertisement
Guest User

minify batchfile

a guest
Aug 14th, 2022
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.87 KB | Source Code | 0 0
  1. ::This batchfile assumes that the server's C:/ drive is mounted as a network drive at Y:/ and you checked out the repository at C:/something. Modify as needed.
  2. del /f /s /q "Y:/wamp/www/"
  3. rmdir /s /q "Y:/wamp/www/"
  4. cd /D "Y:/wamp"
  5. mkdir www
  6. ::echo d | xcopy "C:/something/src/*" "Y:/wamp/www/" /e /s /f /y /d
  7. echo d | xcopy "C:/something/src/*" "Y:/wamp/www/" /v /f /g /s /e /y
  8.  
  9. cd /D "Y:/wamp/www"
  10. rename "assets" "0"
  11. cd /D "0"
  12. rename "suitcase_general.png" "0.png"
  13. rename "code_font.woff2" "1.woff2"
  14. cd /D "Y:/wamp/www"
  15.  
  16. powershell -Command "(gc "Y:/wamp/www/index.html") -replace 'assets/', '0/' | Out-File -encoding ASCII "index.html.optimized.0""
  17. del /f /s /q "index.html"
  18. powershell -Command "(gc "Y:/wamp/www/index.html.optimized.0") -replace 'suitcase_general.png', '0.png' | Out-File -encoding ASCII "index.html.optimized.1""
  19. del /f /s /q "index.html.optimized.0"
  20. rename "index.html.optimized.1" "index.html"
  21.  
  22. powershell -Command "(gc "Y:/wamp/www/index.css") -replace 'assets/', '0/' | Out-File -encoding ASCII "index.css.optimized.0""
  23. del /f /s /q "index.css"
  24. powershell -Command "(gc "Y:/wamp/www/index.css.optimized.0") -replace 'code_font.woff2', '1.woff2' | Out-File -encoding ASCII "index.css.optimized.1""
  25. del /f /s /q "index.css.optimized.0"
  26. rename "index.css.optimized.1" "index.css"
  27.  
  28. powershell -Command "(gc "Y:/wamp/www/index.js") -replace 'tishalongname', '_1' | Out-File -encoding ASCII "index.js.optimized.0""
  29. del /f /s /q "index.js"
  30. rename "index.js.optimized.0" "index.js"
  31.  
  32. minify "index.html" > "index.html.minified"
  33. minify "index.css" > "index.css.minified"
  34. minify "index.js" > "index.js.minified"
  35.  
  36. del /f /s /q "index.html"
  37. del /f /s /q "index.css"
  38. del /f /s /q "index.js"
  39.  
  40. rename "index.html.minified" "index.html"
  41. rename "index.css.minified" "index.css"
  42. rename "index.js.minified" "index.js"
  43.  
  44. del ".minify.json" /f /s /q
  45.  
  46. cd /D "C:/something"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement