Work around another bug in OpenSSH on Windows

This commit is contained in:
Matthias Pigulla 2021-03-02 15:29:19 +00:00
parent cbf6c2b3c2
commit e35dbcbae9
2 changed files with 8 additions and 2 deletions

5
dist/index.js vendored
View file

@ -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);

View file

@ -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);