2024-02-28 21:10:06 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
APP_PATH=$(cd $(dirname $0) && pwd)
|
|
|
|
TMP_FILE=$(mktemp)
|
2024-03-11 08:18:21 +00:00
|
|
|
FINAL_FILE="${APP_PATH}/minify.html"
|
2024-02-28 21:10:06 +00:00
|
|
|
cp "$APP_PATH/index.html" "$TMP_FILE"
|
|
|
|
sed -ri "s/^\s+//" "$TMP_FILE"
|
|
|
|
sed -ri "s=^//.*$==" "$TMP_FILE"
|
|
|
|
sed -ri 's="=\\"=g' "$TMP_FILE"
|
|
|
|
tr -d '\n' < "$TMP_FILE" > "$FINAL_FILE"
|
2024-03-11 08:18:21 +00:00
|
|
|
sed -Ei 's= {2,}= =g' "$FINAL_FILE"
|
|
|
|
cat "$FINAL_FILE"
|
|
|
|
rm "$TMP_FILE"
|