mirror of
https://github.com/webfactory/ssh-agent.git
synced 2026-03-31 23:39:07 +08:00
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.
This commit is contained in:
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -371,7 +371,7 @@ try {
|
|||||||
|
|
||||||
console.log('Configuring deployment key(s)');
|
console.log('Configuring deployment key(s)');
|
||||||
|
|
||||||
child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
|
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
|
||||||
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
|
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
|
||||||
|
|
||||||
if (!parts) {
|
if (!parts) {
|
||||||
|
|||||||
2
index.js
2
index.js
@@ -51,7 +51,7 @@ try {
|
|||||||
|
|
||||||
console.log('Configuring deployment key(s)');
|
console.log('Configuring deployment key(s)');
|
||||||
|
|
||||||
child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) {
|
child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) {
|
||||||
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
|
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
|
||||||
|
|
||||||
if (!parts) {
|
if (!parts) {
|
||||||
|
|||||||
Reference in New Issue
Block a user