Skip to content
Snippets Groups Projects
Unverified Commit d0fb3b76 authored by Henk Kraal's avatar Henk Kraal Committed by GitHub
Browse files

fix(git): Add a newline to the SSH private key (#34674)


Co-authored-by: default avatarRhys Arkins <rhys@arkins.net>
parent 50c09b1e
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,7 @@ class SSHKey extends PrivateKey {
if (await this.hasPassphrase(keyFileName)) {
throw new Error('SSH key must have an empty passhprase');
}
await fs.outputFile(keyFileName, this.key);
await fs.outputFile(keyFileName, this.key.replace(/\n?$/, '\n'));
process.on('exit', () => fs.removeSync(keyFileName));
await fs.chmod(keyFileName, 0o600);
// HACK: `git` calls `ssh-keygen -Y sign ...` internally for SSH-based
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment