text: // Generated by LiveScript 1.2.0
  (function(){
    var FileIO, Components, Container, Containers, GlobalConfig, gconf, Configurator;
    FileIO = require('../util/file-io');
    Components = require('../component/components');
    Container = require('./container');
    Containers = require('./containers');
    GlobalConfig = require('../global-config');
    gconf = new GlobalConfig;
    module.exports = Configurator = (function(){
      Configurator.displayName = 'Configurator';
      var prototype = Configurator.prototype, constructor = Configurator;
      importAll$(prototype, arguments[0]);
      function Configurator(options){
        this.options = options != null
          ? options
          : {};
        this.file = this.options.configFile || this.configFile();
        this.validate();
        this.read();
        this.config = this.json().config || {};
        this;
      }
      prototype.configFile = function(){
        if (this.options.env) {
          return this.envFile();
        } else {
          return gconf.config.file;
        }
      };
      prototype.envFile = function(){
        return [gconf.dir, this.options.env, 'config.json'].join('/');
      };
      prototype.validate = function(){
        if (!this.exists()) {
          throw new Error("File " + this.file + " does not exist");
        }
      };
      prototype.install = function(){
        return this.containers().install();
      };
      prototype.build = function(cb){
        cb || (cb = this.options.cb);
        this.install();
        return this.containers().build(cb);
      };
      prototype.containers = function(){
        return this._containers || (this._containers = new Containers(this.containerObjs(), this.config));
      };
      prototype.containerObjs = function(){
        return this._containerObjs || (this._containerObjs = this.json().containers);
      };
      return Configurator;
    }(FileIO));
    function importAll$(obj, src){
      for (var key in src) obj[key] = src[key];
      return obj;
    }
  }).call(this);
  