From e04a165d6995493aec64c6472c687402c9ed0c91 Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Mon, 4 May 2026 00:09:49 +0800 Subject: [PATCH] fix: start.sh detects embedded web file changes; rebuild on JS/CSS change --- start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/start.sh b/start.sh index e9b594c..99d1638 100755 --- a/start.sh +++ b/start.sh @@ -30,8 +30,7 @@ if ss -tlnp 2>/dev/null | grep -q ":$PORT "; then fi # 编译(如果源码或嵌入文件有变更) -WEB_FILES=$(find web/static -name '*.html' -o -name '*.js' -o -name '*.css' 2>/dev/null) -if [ ! -x "$BIN" ] || [ -n "$(find . -name '*.go' $WEB_FILES -newer "$BIN" 2>/dev/null | head -1)" ]; then +if [ ! -x "$BIN" ] || [ -n "$(find . -name '*.go' -newer "$BIN" 2>/dev/null | head -1)" ] || [ -n "$(find web/static -newer "$BIN" 2>/dev/null | head -1)" ]; then echo "[start] 编译新二进制..." go build -o "$BIN" . 2>&1 fi