rm unecessary comments

This commit is contained in:
Spirit 👾 2024-08-27 19:03:59 +03:00
parent 12f7168961
commit 7f604771f1

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# Known issues: # Known issues:
# - if html line have two paths only one file considered # - it graps only one file path from each HTML line and removes other paths in the same line
# - fails if js file has backticks # - fails if js file has backticks
command -v html-minifier >/dev/null 2>&1 || { echo "Error: to install missing deps run: npm i -g html-minifier uglify-js clean-css-cli svgo" >&2; exit 1; } command -v html-minifier >/dev/null 2>&1 || { echo "Error: to install missing deps run: npm i -g html-minifier uglify-js clean-css-cli svgo" >&2; exit 1; }
@ -36,7 +36,7 @@ if [[ -f "$html_file" ]]; then
} }
} }
' "$html_file" > "${html_file}.tmp" ' "$html_file" > "${html_file}.tmp"
# Minify and replace content
while IFS= read -r line; do while IFS= read -r line; do
if [[ $line =~ ´([^\"]+)´ ]]; then if [[ $line =~ ´([^\"]+)´ ]]; then
file="${BASH_REMATCH[1]}" file="${BASH_REMATCH[1]}"