fix: install.sh 使用 LF 换行,避免 Linux 执行报错
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
* text=auto
|
||||||
|
*.sh text eol=lf
|
||||||
|
*.bash text eol=lf
|
||||||
|
deploy/* text eol=lf
|
||||||
@@ -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`
|
||||||
|
|||||||
Reference in New Issue
Block a user