From d084aa544fb5bb9b37214a6ce408bbcd9a589954 Mon Sep 17 00:00:00 2001 From: leefer Date: Sun, 27 Sep 2026 21:10:53 +0800 Subject: [PATCH] =?UTF-8?q?Windows:ssh-tunnel=20=E4=B8=80=E9=94=AE?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E8=A1=8C=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 仓库根新增 ssh-tunnel.cmd(调用 .venv python + cli.py,与 GUI 共用配置) - install.ps1 自动把 ~/ssh-e2e 加入用户 PATH,新开终端任意位置可敲 ssh-tunnel --- install.ps1 | 11 +++++++++++ ssh-tunnel.cmd | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 ssh-tunnel.cmd diff --git a/install.ps1 b/install.ps1 index 71a7602..b43057d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -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 diff --git a/ssh-tunnel.cmd b/ssh-tunnel.cmd new file mode 100644 index 0000000..424c11f --- /dev/null +++ b/ssh-tunnel.cmd @@ -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%