Use absolute path for askpass.exe

This commit is contained in:
Matthias Pigulla 2021-03-01 08:13:10 +00:00
parent c91aeeb123
commit 18f53866de
2 changed files with 2 additions and 16 deletions

9
dist/index.js vendored
View file

@ -193,14 +193,7 @@ try {
// Load key into agent // Load key into agent
var sshAdd; var sshAdd;
try { child_process.execFileSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit' });
let sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'askpass' } });
} catch (exception) {
console.log(sshAdd.toString());
console.log(exception);
throw exception;
}
console.log(sshAdd);
output.toString().split(/\r?\n/).forEach(function(key) { output.toString().split(/\r?\n/).forEach(function(key) {
let parts = key.match(/^Key has comment '.*\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+?)(?=\.git|\s|\')/); let parts = key.match(/^Key has comment '.*\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+?)(?=\.git|\s|\')/);

View file

@ -76,14 +76,7 @@ try {
// Load key into agent // Load key into agent
var sshAdd; var sshAdd;
try { child_process.execFileSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit' });
let sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'askpass' } });
} catch (exception) {
console.log(sshAdd.toString());
console.log(exception);
throw exception;
}
console.log(sshAdd);
output.toString().split(/\r?\n/).forEach(function(key) { output.toString().split(/\r?\n/).forEach(function(key) {
let parts = key.match(/^Key has comment '.*\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+?)(?=\.git|\s|\')/); let parts = key.match(/^Key has comment '.*\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+?)(?=\.git|\s|\')/);