mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2024-11-12 05:38:05 +00:00
Merge pull request #156 from mansandersson/fix-key-line-endings
Normalize line endings in SSH key for the underlying OS
This commit is contained in:
commit
448aa45aa1
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -1,5 +1,6 @@
|
||||
const { join } = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
const { EOL } = require('os');
|
||||
const { writeToFile } = require('./helpers');
|
||||
|
||||
const KNOWN_HOSTS = 'known_hosts';
|
||||
@ -19,7 +20,7 @@ const addSshKey = (content, deployKeyName) => {
|
||||
const { dir, filename } = getPrivateKeyPath(deployKeyName);
|
||||
writeToFile({ dir, filename: KNOWN_HOSTS, content: '' });
|
||||
console.log('✅ [SSH] known_hosts file ensured', dir);
|
||||
writeToFile({ dir, filename, content: `${content}\r\n`, isRequired: true, mode: '0400' });
|
||||
writeToFile({ dir, filename, content: `${content}${EOL}`, isRequired: true, mode: '0400' });
|
||||
console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user