From e35dbcbae98885e3e93a4f675d55aca1afb234b9 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Tue, 2 Mar 2021 15:29:19 +0000 Subject: [PATCH] Work around another bug in OpenSSH on Windows --- dist/index.js | 5 ++++- index.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 862e0a4..9eef630 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); diff --git a/index.js b/index.js index 7496a71..1efbe0d 100644 --- a/index.js +++ b/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);