mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-27 03:13:17 +00:00
Work around another bug in OpenSSH on Windows
This commit is contained in:
parent
cbf6c2b3c2
commit
e35dbcbae9
2 changed files with 8 additions and 2 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
@ -137,6 +137,10 @@ try {
|
|||
console.log('Preparing ssh-agent service on Windows');
|
||||
child_process.execSync('sc config ssh-agent start=demand', { stdio: 'inherit' });
|
||||
|
||||
// Work around https://github.com/PowerShell/openssh-portable/pull/447 by creating a \dev\tty file
|
||||
fs.mkdirSync('/dev');
|
||||
fs.closeSync(fs.openSync('dev/tty', 'a'));
|
||||
|
||||
home = os.homedir();
|
||||
} else {
|
||||
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
|
||||
|
@ -216,7 +220,6 @@ try {
|
|||
+ ` HostName github.com\n`
|
||||
+ ` User git\n`
|
||||
+ ` IdentitiesOnly no\n`
|
||||
+ ` AddKeysToAgent yes\n`
|
||||
+ ` IdentityFile ${keyFile}\n`;
|
||||
|
||||
fs.appendFileSync(`${homeSsh}/config`, sshConfig);
|
||||
|
|
5
index.js
5
index.js
|
@ -20,6 +20,10 @@ try {
|
|||
console.log('Preparing ssh-agent service on Windows');
|
||||
child_process.execSync('sc config ssh-agent start=demand', { stdio: 'inherit' });
|
||||
|
||||
// Work around https://github.com/PowerShell/openssh-portable/pull/447 by creating a \dev\tty file
|
||||
fs.mkdirSync('/dev');
|
||||
fs.closeSync(fs.openSync('dev/tty', 'a'));
|
||||
|
||||
home = os.homedir();
|
||||
} else {
|
||||
// Use getent() system call, since this is what ssh does; makes a difference in Docker-based
|
||||
|
@ -99,7 +103,6 @@ try {
|
|||
+ ` HostName github.com\n`
|
||||
+ ` User git\n`
|
||||
+ ` IdentitiesOnly no\n`
|
||||
+ ` AddKeysToAgent yes\n`
|
||||
+ ` IdentityFile ${keyFile}\n`;
|
||||
|
||||
fs.appendFileSync(`${homeSsh}/config`, sshConfig);
|
||||
|
|
Loading…
Reference in a new issue