8000 Avoid nonsensical log message (#139) · webfactory/ssh-agent@0a7dc1c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0a7dc1c

Browse files
authored
Avoid nonsensical log message (#139)
This change avoids the `Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.` log message that was caused by inappropriate parsing of `ssh-add -L` output and confused a lot of users already.
1 parent b19b28d commit 0a7dc1c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ try {
371371

372372
console.log('Configuring deployment key(s)');
373373

374-
child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
374+
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
375375
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
376376

377377
if (!parts) {

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ try {
5151

5252
console.log('Configuring deployment key(s)');
5353

54-
child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
54+
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
5555
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
5656

5757
if (!parts) {

0 commit comments

Comments
 (0)
0