mirror of
https://github.com/easingthemes/ssh-deploy.git
synced 2026-06-26 15:09:58 +00:00
Merge 3405be3b42 into cf583aab4f
This commit is contained in:
commit
e923ff605c
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
15
package-lock.json
generated
15
package-lock.json
generated
@ -1,14 +1,15 @@
|
|||||||
{
|
{
|
||||||
"name": "@draganfilipovic/ssh-deploy",
|
"name": "@draganfilipovic/ssh-deploy",
|
||||||
"version": "4.1.7",
|
"version": "4.1.8",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@draganfilipovic/ssh-deploy",
|
"name": "@draganfilipovic/ssh-deploy",
|
||||||
"version": "4.1.7",
|
"version": "4.1.8",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"os": "^0.1.2",
|
||||||
"rsyncwrapper": "^3.0.1"
|
"rsyncwrapper": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -1483,6 +1484,11 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/os": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ=="
|
||||||
|
},
|
||||||
"node_modules/p-limit": {
|
"node_modules/p-limit": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||||
@ -3061,6 +3067,11 @@
|
|||||||
"word-wrap": "^1.2.3"
|
"word-wrap": "^1.2.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"os": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/os/-/os-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-ZoXJkvAnljwvc56MbvhtKVWmSkzV712k42Is2mA0+0KTSRakq5XXuXpjZjgAt9ctzl51ojhQWakQQpmOvXWfjQ=="
|
||||||
|
},
|
||||||
"p-limit": {
|
"p-limit": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/easingthemes/ssh-deploy#readme",
|
"homepage": "https://github.com/easingthemes/ssh-deploy#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"os": "^0.1.2",
|
||||||
"rsyncwrapper": "^3.0.1"
|
"rsyncwrapper": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
const { join } = require('path');
|
const { join } = require('path');
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
const { writeToFile } = require('./helpers');
|
const { writeToFile } = require('./helpers');
|
||||||
|
const { EOL } = require('os');
|
||||||
|
|
||||||
const KNOWN_HOSTS = 'known_hosts';
|
const KNOWN_HOSTS = 'known_hosts';
|
||||||
const getPrivateKeyPath = (filename = '') => {
|
const getPrivateKeyPath = (filename = '') => {
|
||||||
@ -19,7 +20,7 @@ const addSshKey = (content, deployKeyName) => {
|
|||||||
const { dir, filename } = getPrivateKeyPath(deployKeyName);
|
const { dir, filename } = getPrivateKeyPath(deployKeyName);
|
||||||
writeToFile({ dir, filename: KNOWN_HOSTS, content: '' });
|
writeToFile({ dir, filename: KNOWN_HOSTS, content: '' });
|
||||||
console.log('✅ [SSH] known_hosts file ensured', dir);
|
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);
|
console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user