fix: install.sh 使用 LF 换行,避免 Linux 执行报错

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-05-27 14:25:21 +08:00
parent 95b55e41f3
commit aa33cb5da6
3 changed files with 89 additions and 70 deletions
+4
View File
@@ -0,0 +1,4 @@
* text=auto
*.sh text eol=lf
*.bash text eol=lf
deploy/* text eol=lf
+15
View File
@@ -144,6 +144,21 @@ pm2 restart chart-label-tool
## 故障排查 ## 故障排查
### `install.sh: $'\r': command not found`
脚本在 Windows 下编辑后可能带 **CRLF** 换行,Linux 无法执行。任选一种修复:
```bash
# 方式一:去掉回车符后重新执行
sed -i 's/\r$//' /opt/chart-label-tool/deploy/install.sh
sudo bash /opt/chart-label-tool/deploy/install.sh
# 方式二:拉取已修复的仓库(含 .gitattributes 强制 LF
cd /opt/chart-label-tool && git pull
sed -i 's/\r$//' deploy/install.sh
sudo bash deploy/install.sh
```
### 页面无法打开 ### 页面无法打开
1. `pm2 status` 确认进程为 `online` 1. `pm2 status` 确认进程为 `online`