Windows:ssh-tunnel 一键命令行入口
- 仓库根新增 ssh-tunnel.cmd(调用 .venv python + cli.py,与 GUI 共用配置) - install.ps1 自动把 ~/ssh-e2e 加入用户 PATH,新开终端任意位置可敲 ssh-tunnel
This commit is contained in:
+11
@@ -54,6 +54,17 @@ if (-not (Test-Path (Join-Path $AppDir ".venv\Scripts\pythonw.exe"))) {
|
||||
& (Join-Path $AppDir ".venv\Scripts\python.exe") -m pip install --quiet --disable-pip-version-check -r (Join-Path $AppDir "requirements.txt")
|
||||
}
|
||||
|
||||
# ---------- ssh-tunnel 命令(命令行向导,与 GUI 共用配置) ----------
|
||||
$cmdPath = Join-Path $AppDir "ssh-tunnel.cmd"
|
||||
if (-not (Test-Path $cmdPath)) {
|
||||
Say "缺少 ssh-tunnel.cmd(仓库已更新,请重新运行安装)"
|
||||
}
|
||||
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
||||
if ($userPath -notlike "*$AppDir*") {
|
||||
[Environment]::SetEnvironmentVariable("Path", ($userPath.TrimEnd(";") + ";" + $AppDir), "User")
|
||||
Say "已把 $AppDir 加入用户 PATH — 新开终端后可直接输入 ssh-tunnel"
|
||||
}
|
||||
|
||||
# ---------- 桌面快捷方式 ----------
|
||||
try {
|
||||
$ws = New-Object -ComObject WScript.Shell
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
rem ssh-e2e CLI launcher (same wizard as Linux/macOS)
|
||||
setlocal
|
||||
set "HERE=%~dp0"
|
||||
"%HERE%.venv\Scripts\python.exe" "%HERE%cli.py" %*
|
||||
exit /b %ERRORLEVEL%
|
||||
Reference in New Issue
Block a user