Remove native module 'os' from package.json file

This commit is contained in:
Måns Andersson
2023-09-25 20:33:00 +02:00
committed by Måns Andersson
parent 3405be3b42
commit 3cd2cdf0ef
4 changed files with 8 additions and 20 deletions

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

15
package-lock.json generated
View File

@@ -1,15 +1,14 @@
{
"name": "@draganfilipovic/ssh-deploy",
"version": "4.1.8",
"version": "4.1.7",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@draganfilipovic/ssh-deploy",
"version": "4.1.8",
"version": "4.1.7",
"license": "MIT",
"dependencies": {
"os": "^0.1.2",
"rsyncwrapper": "^3.0.1"
},
"devDependencies": {
@@ -1484,11 +1483,6 @@
"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": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@@ -3067,11 +3061,6 @@
"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": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",

View File

@@ -30,7 +30,6 @@
},
"homepage": "https://github.com/easingthemes/ssh-deploy#readme",
"dependencies": {
"os": "^0.1.2",
"rsyncwrapper": "^3.0.1"
},
"devDependencies": {

View File

@@ -1,7 +1,7 @@
const { join } = require('path');
const { execSync } = require('child_process');
const { writeToFile } = require('./helpers');
const { EOL } = require('os');
const { writeToFile } = require('./helpers');
const KNOWN_HOSTS = 'known_hosts';
const getPrivateKeyPath = (filename = '') => {
@@ -19,9 +19,9 @@ const getPrivateKeyPath = (filename = '') => {
const addSshKey = (content, deployKeyName) => {
const { dir, filename } = getPrivateKeyPath(deployKeyName);
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}${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);
};
const updateKnownHosts = (host, remotePort) => {
@@ -32,9 +32,9 @@ const updateKnownHosts = (host, remotePort) => {
stdio: 'inherit'
});
} catch (error) {
console.error(' [SSH] Adding host to `known_hosts` ERROR', host, error.message);
console.error('??? [SSH] Adding host to `known_hosts` ERROR', host, error.message);
}
console.log(' [SSH] Adding host to `known_hosts` DONE', host, knownHostsPath);
console.log('??? [SSH] Adding host to `known_hosts` DONE', host, knownHostsPath);
};
module.exports = {