Adding env handlement for ssh profile sessions (#6242)

This commit is contained in:
woodmeal 2022-04-22 09:50:35 +02:00 committed by GitHub
parent 58f2c3d081
commit 25f5cf04ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -306,6 +306,14 @@ export class SSHSession {
this.authUsername = 'root'
}
}
if (this.authUsername?.startsWith('$')) {
try {
const result = process.env[this.authUsername.slice(1)]
this.authUsername = result ?? this.authUsername
} catch {
this.authUsername = 'root'
}
}
ssh.connect({
host: this.profile.options.host.trim(),

View file

@ -10,6 +10,7 @@
"paths": {
"tabby-*": ["../../tabby-*"],
"*": ["../../app/node_modules/*"]
}
},
"types": ["node"]
}
}