Ver Fonte

Rimossi riferimenti e metodi ai config files usati da hostile

mdomenici há 1 ano atrás
pai
commit
e2ccfa86ff
2 ficheiros alterados com 1 adições e 29 exclusões
  1. 1 26
      bin/classes/ProjectEnvironment.js
  2. 0 3
      bin/commands/start.js

+ 1 - 26
bin/classes/ProjectEnvironment.js

@@ -20,32 +20,11 @@ class ProjectEnvironment {
   }
 
   _setEnvironment(env) {
-    if (
-      !this._loadConfigFile() ||
-      !this._loadDockerComposeFile()
-    ) {
+    if (!this._loadDockerComposeFile()) {
       throw [`Unable to load %s environment`, colors.bold(env)];
     }
   }
 
-  _loadConfigFile() {
-    const configFilename = `config.${this._env}.json`;
-    const configFilepath = path.join(this._cwd, configFilename);
-
-    if (!fs.existsSync(configFilepath)) {
-      return false;
-    }
-
-    try {
-      const config = JSON.parse(fs.readFileSync(configFilepath, 'utf8'));
-      this._config = config;
-    } catch (ex) {
-      return false;
-    }
-
-    return true;
-  }
-
   _loadDockerComposeFile() {
     const dockerComposeFilename = `docker-compose.${this._env}.yml`;
     const dockerComposeFilepath = path.join(this._cwd, dockerComposeFilename);
@@ -91,10 +70,6 @@ class ProjectEnvironment {
     return this._env;
   }
 
-  getHosts() {
-    return this._config['hosts'] || {};
-  }
-
   async getServices() {
     const data = await docker.configServices({ ...this.getDockerOptions(), ...{ log: false } });
 

+ 0 - 3
bin/commands/start.js

@@ -70,9 +70,6 @@ module.exports = (env) => {
 
     log.log("Starting project (%s environment)...", colors.bold(env));
 
-    // Install hosts
-    installHosts(projectEnv.getHosts());
-
     // Docker up services
     runServices(projectEnv);