mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-12 22:16:42 +08:00
Use tilde (~) prefix for global SSH config to ensure it loads last
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
542832d3d1
commit
a764af9c92
|
|
@ -133,15 +133,15 @@ export default class SshKeyService {
|
|||
}
|
||||
|
||||
public async addGlobalSSHKey(key: string, alias: string): Promise<void> {
|
||||
await this.generatePrivateKeyFile(`zzz_global_${alias}`, key);
|
||||
await this.generatePrivateKeyFile(`~global_${alias}`, key);
|
||||
// Create a global SSH config entry that matches all hosts
|
||||
// This allows the key to be used for any Git repository
|
||||
await this.generateGlobalSshConfig(`zzz_global_${alias}`);
|
||||
await this.generateGlobalSshConfig(`~global_${alias}`);
|
||||
}
|
||||
|
||||
public async removeGlobalSSHKey(alias: string): Promise<void> {
|
||||
await this.removePrivateKeyFile(`zzz_global_${alias}`);
|
||||
await this.removeSshConfig(`zzz_global_${alias}`);
|
||||
await this.removePrivateKeyFile(`~global_${alias}`);
|
||||
await this.removeSshConfig(`~global_${alias}`);
|
||||
}
|
||||
|
||||
private async generateGlobalSshConfig(alias: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user