修复 deploy.sh Windows 换行导致 Linux 无法执行

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-15 11:20:35 +08:00
parent 7561bf88c5
commit 49b11eeb00
2 changed files with 87 additions and 84 deletions
+3
View File
@@ -0,0 +1,3 @@
# Shell 脚本在 Linux 上必须使用 LF 换行
*.sh text eol=lf
deploy.sh text eol=lf
+1 -1
View File
@@ -58,7 +58,7 @@ pip install --upgrade pip -q
pip install -r "$APP_DIR/requirements.txt" -q pip install -r "$APP_DIR/requirements.txt" -q
if [ ! -f "$APP_DIR/.env" ]; then if [ ! -f "$APP_DIR/.env" ]; then
echo "==> 生成 .env(请编辑 ADMIN_PASSWORD、THS_REFRESH_TOKEN..." echo "==> 生成 .env(请编辑 ADMIN_PASSWORD 后重启..."
cp "$APP_DIR/.env.example" "$APP_DIR/.env" cp "$APP_DIR/.env.example" "$APP_DIR/.env"
RAND_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))") RAND_KEY=$(python3 -c "import secrets; print(secrets.token_hex(32))")
sed -i "s/change-this-to-a-random-secret-key/${RAND_KEY}/" "$APP_DIR/.env" sed -i "s/change-this-to-a-random-secret-key/${RAND_KEY}/" "$APP_DIR/.env"