-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcordis.patch.yml
More file actions
22 lines (22 loc) · 1.12 KB
/
Copy pathcordis.patch.yml
File metadata and controls
22 lines (22 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# @zhangfengshun/dsh-remote-ssh bundle patch
#
# 通过官方 CLI 安装时会依据此声明把 `@zhangfengshun/dsh-remote-ssh` 追加到 profile 的 bundle 栈:
# dsh plugin --profile <name> add @zhangfengshun/dsh-remote-ssh@<version>
- insert:
- id: remote-ssh
name: '@zhangfengshun/dsh-remote-ssh'
# 自动覆盖 better-sidebar 的 shell 配置,指向本插件生成的 shell wrapper。
# wrapper 脚本在插件 apply() 时写入 ~/.dsh/remote-ssh/dsh-remote-shell[.cmd]:
# - 远程工作区(cwd 含 .remote-ssh.json 且 keyPath 非空)→ ssh -tt 连远程
# - 本地工作区 → 照常启动本地 shell
# 路径用 !!js 动态计算,适配不同平台和用户主目录。
- id: better-sidebar
config:
shell: !!js |
(() => {
var homedir = process.env.USERPROFILE || process.env.HOME || process.env.HOMEDRIVE + process.env.HOMEPATH;
var isWin = process.platform === 'win32';
var sep = isWin ? '\\' : '/';
var dir = homedir + sep + '.dsh' + sep + 'remote-ssh';
return isWin ? dir + sep + 'dsh-remote-shell.cmd' : dir + sep + 'dsh-remote-shell';
})()