From 166067472e14837a0ed6e9cedaec671a75ed9ce1 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 1 Mar 2021 08:23:42 +0000 Subject: [PATCH] More debugging --- dist/index.js | 10 +++++++--- index.js | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index dfa6983..e0ac980 100644 --- a/dist/index.js +++ b/dist/index.js @@ -191,10 +191,14 @@ try { } // Load key into agent - var sshAdd; + let sshAdd = undefined; - sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit' }); - console.log(sshAdd.toString()); + try { + sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit', input: '' }); + } catch (exception) { + console.log(sshAdd, exception); + throw exception; + } 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|\')/); diff --git a/index.js b/index.js index 977d403..623a093 100644 --- a/index.js +++ b/index.js @@ -74,10 +74,14 @@ try { } // Load key into agent - var sshAdd; + let sshAdd = undefined; - sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit' }); - console.log(sshAdd.toString()); + try { + sshAdd = child_process.execSync(`ssh-add ${keyFile}`, { env: { 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': process.cwd() + '/askpass.exe' }, stdio: 'inherit', input: '' }); + } catch (exception) { + console.log(sshAdd, exception); + throw exception; + } 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|\')/);