docs(win): 分行展示一键部署命令,避免 git 误解析参数
- README: Windows 克隆与启动改为分行,补充单行安全写法与说明 - start.ps1: 无 Git 时 winget/choco 自动安装、PATH 刷新、UTF-8 BOM 与文件头使用说明 Made-with: Cursor
This commit is contained in:
@@ -8,13 +8,23 @@ git clone https://git.51easyai.com/wangbo/easyai.git && cd easyai && chmod +x st
|
||||
|
||||
### Windows
|
||||
|
||||
在 PowerShell 中**分行执行**下面三行(不要与 `git clone` 粘成一行且漏掉分号,否则 `-ExecutionPolicy` 可能被当成 `git` 的参数,出现 `error: unknown switch 'E'`):
|
||||
|
||||
```powershell
|
||||
git clone https://git.51easyai.com/wangbo/easyai.git; cd easyai; powershell -ExecutionPolicy Bypass -File .\start.ps1
|
||||
git clone "https://git.51easyai.com/wangbo/easyai.git" "easyai"
|
||||
Set-Location ".\easyai"
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\start.ps1"
|
||||
```
|
||||
|
||||
若必须单行粘贴,请用分号分隔整条命令链:
|
||||
|
||||
```powershell
|
||||
git clone "https://git.51easyai.com/wangbo/easyai.git" "easyai"; Set-Location "easyai"; powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\start.ps1"
|
||||
```
|
||||
|
||||
> **Windows 脚本权限说明**:PowerShell 默认禁止运行脚本,直接双击 `start.ps1` 会闪退。
|
||||
>
|
||||
> - **推荐**:使用 `powershell -ExecutionPolicy Bypass -File .\start.ps1` 执行,无需修改系统策略
|
||||
> - **推荐**:使用 `powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\start.ps1"` 执行,无需修改系统策略
|
||||
> - **或**:以管理员身份打开 PowerShell,执行 `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`,之后可直接运行 `.\start.ps1`
|
||||
|
||||
---
|
||||
@@ -438,7 +448,7 @@ PowerShell 默认可能禁止运行脚本,需先执行以下任一方式:
|
||||
|
||||
**方式一:临时允许本次运行(推荐)**
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\start.ps1"
|
||||
```
|
||||
|
||||
**方式二:为当前用户永久放开脚本执行权限**
|
||||
@@ -449,19 +459,21 @@ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||
|
||||
### 启动步骤
|
||||
|
||||
1. 克隆并进入目录
|
||||
1. 克隆并进入目录(**请分行执行**,避免把后续命令当成 `git` 的参数)
|
||||
|
||||
```powershell
|
||||
git clone https://git.51easyai.com/wangbo/easyai.git
|
||||
cd easyai
|
||||
git clone "https://git.51easyai.com/wangbo/easyai.git" "easyai"
|
||||
Set-Location ".\easyai"
|
||||
```
|
||||
|
||||
2. 在 PowerShell 或 CMD 中运行(二选一)
|
||||
|
||||
```powershell
|
||||
# 若已设置 ExecutionPolicy,可直接执行
|
||||
.\start.ps1
|
||||
|
||||
# 未设置时使用 Bypass 方式
|
||||
powershell -ExecutionPolicy Bypass -File .\start.ps1
|
||||
# 未设置时使用 Bypass 方式(推荐带引号的路径)
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\start.ps1"
|
||||
```
|
||||
|
||||
3. 按提示选择 [1] 本地访问 或 [2] 局域网访问,脚本将自动配置并启动 Docker 服务。
|
||||
|
||||
Reference in New Issue
Block a user