From 03fa083affe4b8cf5745a53539fa261513cf9933 Mon Sep 17 00:00:00 2001 From: Spirit Date: Mon, 26 Aug 2024 17:22:40 +0300 Subject: [PATCH] alter the original file and make a backup --- html-minify.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html-minify.sh b/html-minify.sh index e5927de..42bdfb2 100755 --- a/html-minify.sh +++ b/html-minify.sh @@ -68,8 +68,9 @@ if [[ -f "$html_file" ]]; then fi done < "${html_file}.tmp" - html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true "${html_file}.tmp" > "min.${html_file}" - echo generated "min.${html_file}" + cp "$html_file" ".original-${html_file}" + echo generated ".original-${html_file}" + html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-tag-whitespace --use-short-doctype --minify-css true --minify-js true "${html_file}.tmp" > "$html_file" fi # Clean up generated files