Просмотр исходного кода

Rimossi is-root e hostile perchè non usati

mdomenici 1 год назад
Родитель
Сommit
0745f29fea
3 измененных файлов с 1 добавлено и 37 удалено
  1. 0 16
      bin/commands/start.js
  2. 0 18
      bin/commands/stop.js
  3. 1 3
      package.json

+ 0 - 16
bin/commands/start.js

@@ -1,26 +1,10 @@
-import isRoot from 'is-root';
-
 const colors = require('colors');
 const docker = require('docker-compose');
-const hostile = require('hostile');
 const path = require('path');
 
 const ProjectEnvironment = require('../classes/ProjectEnvironment');
 const log = require('../inc/log');
 
-const installHosts = (hosts) => {
-  if (!isRoot()) {
-    log.warn('Unable to set hosts because you need root privileges');
-  } else {
-    for (var ip in hosts) {
-      const hostsString = hosts[ip].join(' ');
-
-      log.log('Installing hosts for %s: %s', ip, hostsString);
-      hostile.set(ip, hostsString);
-    }
-  }
-};
-
 const runServiceStart = (service, projectEnv) => {
   const env = projectEnv.getEnv();
   const scripts = [

+ 0 - 18
bin/commands/stop.js

@@ -1,25 +1,9 @@
-import isRoot from 'is-root';
-
 const colors = require('colors');
 const docker = require('docker-compose');
-const hostile = require('hostile');
 
 const ProjectEnvironment = require('../classes/ProjectEnvironment');
 const log = require('../inc/log');
 
-const uninstallHosts = (hosts) => {
-  if (!isRoot()) {
-    log.warn('Unable to unset hosts because you need root privileges');
-  } else {
-    for (var ip in hosts) {
-      const hostsString = hosts[ip].join(' ');
-
-      log.log('Uninstalling hosts for %s: %s', ip, hostsString);
-      hostile.remove(ip, hostsString);
-    }
-  }
-};
-
 const stopServices = async (projectEnv) => {
   await docker.down(projectEnv.getDockerOptions());
 };
@@ -29,7 +13,5 @@ module.exports = (env) => {
 
   log.log("Shutting down project (%s environment)...", colors.bold(env));
 
-  uninstallHosts(projectEnv.getHosts());
-
   stopServices(projectEnv);
 };

+ 1 - 3
package.json

@@ -31,9 +31,7 @@
   "dependencies": {
     "colors": "^1.4.0",
     "commander": "^11.0.0",
-    "docker-compose": "^0.24.2",
-    "hostile": "^1.3.3",
-    "is-root": "^3.0.0"
+    "docker-compose": "^0.24.2"
   },
   "deprecated": false,
   "description": "",