|
@@ -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);
|
|
|
};
|