esp32-timed-switch/html/minify.sh

11 lines
291 B
Bash
Raw Normal View History

#!/usr/bin/env bash
APP_PATH=$(cd $(dirname $0) && pwd)
TMP_FILE=$(mktemp)
FINAL_FILE=minify.html
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"
cat "$FINAL_FILE"