MCPcopy Create free account
hub / github.com/easingthemes/ssh-deploy / addSshKey

Function addSshKey

src/sshKey.js:19–25  ·  view source on GitHub ↗
(content, deployKeyName)

Source from the content-addressed store, hash-verified

17};
18
19const addSshKey = (content, deployKeyName) => {
20 const { dir, filename } = getPrivateKeyPath(deployKeyName);
21 writeToFile({ dir, filename: KNOWN_HOSTS, content: '' });
22 console.log('✅ [SSH] known_hosts file ensured', dir);
23 writeToFile({ dir, filename, content: `${content}${EOL}`, isRequired: true, mode: '0400' });
24 console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename);
25};
26
27const updateKnownHosts = (host, remotePort) => {
28 const { knownHostsPath } = getPrivateKeyPath();

Callers 1

runFunction · 0.85

Calls 2

getPrivateKeyPathFunction · 0.85
writeToFileFunction · 0.85

Tested by

no test coverage detected