config is simply taken for the dirname where zest.json can be found
966155
function(config, environment) {
  //load configuration
  if (config == null)
    config = process.cwd() + (windows ? '\\' : '/');
    
  if (typeof config == 'string') {
    var isDir = (!windows && config.substr(config.length - 1, 1) == '/') || (windows && config.substr(config.length - 1, 1) == '\\');
    //config file path is taken to be app directory
    defaultConfig.appDir = isDir ? path.resolve(config) : path.dirname(path.resolve(config));
    defaultConfig.require.server.paths['$'] = defaultConfig.appDir;
    
    //load cson if necessary
    if (isDir && fs.existsSync(path.resolve(config, 'zest.cson')) || config.substr(config.length - 4, 4) == 'cson')
      return loadConfig(getCSONConfigFile(isDir ? path.resolve(config, 'zest.cson') : path.resolve(config)), environment);
    //otherwise load config as a json file
    else
      return loadConfig(getJSONConfigFile(isDir ? path.resolve(config, 'zest.json') : path.resolve(config)), environment);
  }
  
  if (setConfig)
    throw 'Configuration has already been set. Start a new server instance for alternative configuration.';
  setConfig = true;
  
  
  function deepPrepend(a, b) {
    for (var p in b) {
      if (b[p] instanceof Array) {
        a[p] = a[p] || [];
        a[p] = b[p].concat(a[p]);
      }
      else if (typeof b[p] == 'object' && b[p] !== null && a[p] !== null) {
        a[p] = a[p] || {};
        deepPrepend(a[p], b[p]);
      }
      else if (a[p] === undefined)
        a[p] = b[p];
    }
  }
  
  deepPrepend(config, defaultConfig);
  
  //provide default configurations, starting with the environment mode config
  var outConfig = config.environments[environment || config.environment];
  
  if (typeof outConfig == 'undefined')
    throw 'No configuration provided for environment "' + environment + '".';
  
  delete config.environments;
  
  deepPrepend(outConfig, config);
  
  //derive client, build, server and production require configs
  var requireConfig = {
    server: outConfig.require.server,
    client: outConfig.require.client,
    build: outConfig.require.build
  };
  delete outConfig.require.server;
  delete outConfig.require.client;
  delete outConfig.require.build;
  
  deepPrepend(requireConfig.server, outConfig.require);
  deepPrepend(requireConfig.client, outConfig.require);
  deepPrepend(requireConfig.build, outConfig.require);
  
  outConfig.require = requireConfig;
  
  //set directories - cant override
  outConfig.require.server.baseUrl = path.resolve(outConfig.appDir, outConfig.publicDir, outConfig.baseDir);
  outConfig.require.client.baseUrl = '/' + outConfig.baseDir;

  // type attribute
  if (outConfig.typeAttribute && outConfig.typeAttribute != 'component') {
    var clientConfig = (outConfig.require.client.config = outConfig.require.client.config || {});
    clientConfig['zest/render'] = clientConfig['zest/render'] || {};
    clientConfig['zest/render'].typeAttribute = outConfig.typeAttribute;
  }
  
  return outConfig;
}
51099
function resolve( dir ) {
	var udir = dir || configdir();
	if ( udir === null ) {
		debug( 'Unable to resolve user configuration directory.' );
	} else {
		udir = path.resolve( root, udir );
		debug( 'User configuration directory: %s', udir );
	}
	return udir;
}
998054
function configure(config) {
    config = config || {};
    logger.debug('configuring adapters', _.keys(config).join(','));
    _.extend(adapterConfig, _.clone(config));

    logger.debug('configuring builtin adapters');
    _.each(BUILTIN_ADAPTERS, function(adapter) {
        adapterConfig[adapter] = {
            path: path.resolve(__dirname, '../adapters/' + adapter),
            builtin: true
        };
    });
}
90299
function loadSimpleResourceMap(config) {
    return new Promise((resolve, reject) => {

        // Convert Jest config into glob pattern.
        let testPathDirs;
        let testFileExtensions;
        let generatedGlob;

        if (config.testPathDirs.length === 1) {
            testPathDirs = config.testPathDirs[0];
        } else {
            testPathDirs = '{' + config.testPathDirs.join(',') + '}';
        }

        if (config.testFileExtensions.length === 1) {
            testFileExtensions = config.testFileExtensions[0];
        } else {
            testFileExtensions = '{' + config.testFileExtensions.join(',') + '}';
        }

        generatedGlob = testPathDirs + '/' +
            '**/' + config.testDirectoryName + '/**/*.' + testFileExtensions;

        glob(generatedGlob, (err, files) => {
            if (err) {
                reject(err);
            } else {
                let resourceMap;
                resourceMap = {
                    resourcePathMap: {}
                };
                files.forEach(file => {
                    let fullPath = path.resolve(file);
                    resourceMap.resourcePathMap[fullPath] = {
                        path: fullPath
                    };
                });
                resolve(resourceMap);
            }
        });
    });
}
941425
def configs_in(src_dir):
    """"""
    for filename in files_in_dir(src_dir, 'json'):
        with open(os.path.join(src_dir, filename), 'rb') as in_f:
            yield json.load(in_f)
1113242
function(config) {
    var directory = null;

    if(config.workingDir) {
       directory = path.join(config.workingDir, 'level'); 
    } else {
        throw Errors.invalidConfig('Invalid configuration. Working directory not defined.');
    }
    
    return directory;
}
1067715
function distJsFiles() {
        return [{src: cog.pathDist() + cog.getConfig('name') + '.js', dst: cog.pathDist() + cog.getConfig('name') + '.min.js'}];
    }
195846
def _get_config_dirs(self):
        
        _cwd = os.path.split(os.path.abspath(__file__))[0]
        _pdir = os.path.split(_cwd)[0]
        _etcdir = ''.join((_pdir, '/', 'etc/'))
        cfg_dirs = [
            self._fixpath(_cwd),
            self._fixpath('/etc/zvmsdk/'),
            self._fixpath('/etc/'),
            self._fixpath('~'),
            self._fixpath(_etcdir),
        ]
        return [x for x in cfg_dirs if x]
1127957
function readConfigFile() {

  // First try to find the .cz-config.js config file
  var czConfig = findConfig.require(CZ_CONFIG_NAME, {home: false});
  if (czConfig) {
    return czConfig;
  }

  // fallback to locating it using the config block in the nearest package.json
  var pkg = findConfig('package.json', {home: false});
  if (pkg) {
    var pkgDir = path.dirname(pkg);
    pkg = require(pkg);

    if (pkg.config && pkg.config['cz-customizable'] && pkg.config['cz-customizable'].config) {
      // resolve relative to discovered package.json
      var pkgPath = path.resolve(pkgDir, pkg.config['cz-customizable'].config);

      console.info('>>> Using cz-customizable config specified in your package.json: ', pkgPath);

      return require(pkgPath);
    }
  }

  log.warn('Unable to find a configuration file. Please refer to documentation to learn how to ser up: https://github.com/leonardoanalista/cz-customizable#steps "');
}
1192598
function() {
      'use strict';
      var filesToCopy = {
         'widget.json': 'widget.json',
         'gitignore': '.gitignore',
         'spec/spec_runner.html': 'spec/spec_runner.html',
         'spec/spec_runner.js': 'spec/spec_runner.js',
         'spec/widget.spec.js': 'spec/' + this.placeholder.name + '.spec.js'
      };
      var integrationTechnology = this.placeholder.laxarIntegrationTechnology;
      var widget = !this.options.activity;

      if( widget && integrationTechnology !== 'react' ) {
         filesToCopy[ 'default.theme/widget.html' ] = 'default.theme/' + this.placeholder.name + '.html';
      }
      if( widget ) {
         filesToCopy[ 'default.theme/css/widget.css' ] = 'default.theme/css/' + this.placeholder.name + '.css';
      }

      if( integrationTechnology === 'plain' ) {
         if( !widget ) {
            filesToCopy[ 'controller.plain.activity.js' ] = this.placeholder.name + '.js';
         }
         else {
            filesToCopy[ 'controller.plain.widget.js' ] = this.placeholder.name + '.js';
         }
      }
      else if( integrationTechnology === 'angular' ) {
         filesToCopy[ 'controller.angular.js' ] = this.placeholder.name + '.js';
      }
      else if( integrationTechnology === 'react' ) {
         filesToCopy[ 'controller.react.jsx' ] = this.placeholder.name + '.jsx';
      }

      if( this.placeholder.infrastructure ) {
         filesToCopy[ 'README.md' ] = 'README.md';
         if( widget && integrationTechnology !== 'react') {
            filesToCopy[ 'bower.widget.json' ] = 'bower.json';
         }
         else if ( widget && integrationTechnology === 'react' ) {
            filesToCopy[ 'bower.react.widget.json' ] = 'bower.json';
         }
         else {
            filesToCopy[ 'bower.activity.json' ] = 'bower.json';
         }
      }
      for( var file in filesToCopy ) {
         if( filesToCopy.hasOwnProperty( file ) ) {
            this.fs.copyTpl(
               this.templatePath( file ),
               this.destinationPath(
                  path.join( this.widgetDirname, this.placeholder.name, filesToCopy[ file ] )
               ),
               this.placeholder
            );
         }
      }
   }
754199
function loadFromDisk(configInfo, configContext) {
    const config = loadConfigFile(configInfo);

    // loadConfigFile will return null for a `package.json` file that does not have an `eslintConfig` property.
    if (config) {
        return loadObject(configContext, { config, filePath: configInfo.filePath, configFullName: configInfo.configFullName });
    }

    return null;
}
1030082
function locateConfig(url) {
  let configpath = '';

  function check(dir) {
    // Support js, json, and package.json
    const urljs = path.join(dir, DEFAULT_MANIFEST.js);
    const urljson = path.join(dir, DEFAULT_MANIFEST.json);
    const urlpkgjson = path.join(dir, DEFAULT_MANIFEST.pkgjson);
    let urlFinal;

    if (exists((urlFinal = urljs)) || exists((urlFinal = urljson)) || exists((urlFinal = urlpkgjson))) {
      return urlFinal;
    }
    return '';
  }

  if (url) {
    configpath = path.resolve(url);

    try {
      // Try default file name if passed directory
      if (!path.extname(configpath).length || fs.statSync(configpath).isDirectory()) {
        configpath = check(configpath);
        if (!configpath) throw Error('no default found');
      }
    } catch (err) {
      throw Error(strong('buddy') + ' config not found in ' + strong(path.dirname(url)));
    }

    // No url specified
  } else {
    try {
      // Find the first instance of a DEFAULT file based on the current working directory
      configpath = hunt(
        process.cwd(),
        (resource, stat) => {
          if (stat.isFile()) {
            const basename = path.basename(resource);

            return basename == DEFAULT_MANIFEST.js ||
              basename == DEFAULT_MANIFEST.json ||
              basename == DEFAULT_MANIFEST.pkgjson;
          }
        },
        true
      );
    } catch (err) {
      if (!configpath) throw Error(strong('buddy') + ' config not found');
    }
  }

  return configpath;
}
1288345
function getDefaultConfigPath () {
  let filePath
  let i
  let k

  for (k = 0; k < DEFAULT_CONFIG_DIRS.length; k++) {
    for (i = 0; i < SUPPORTED_EXTENSIONS.length; i++) {
      filePath = DEFAULT_CONFIG_DIRS[k] + SUPPORTED_EXTENSIONS[i]
      if (fileUtils.fileExistsSync(filePath)) {
        return filePath
      }
    }
  }

  throw new Error('No config file found')
}
1171552
function setup() {

    // check if config directory is given
    if( _config_path !== -1 ) {

      // get path
      var config_path = path.resolve( process.argv[ _config_path + 1 ] );

      // check if directory exists and is a valid directory
      fs.stat( config_path, function( err, stats ) {
        if( err && err.code === "ENOENT" ) {
          process.stdout.write( "The given directory doesn't exists.\n".red );
        } else if( err ) {

          // unknown error
          process.stdout.write( (err.message + "\n").red );
        } else if( !stats.isDirectory() ) {
          process.stdout.write( "The given config directory is not an actual directory.\n".red );
        } else {
          readConfigDir( config_path );
        }
      } );
      return;
    }

    // ask for config directory
    ask( "Where are your config files? ", function( c_path ) {
        readConfigDir( c_path );
    } );
}
1243760
def symlink_configs
      paths = Dir.glob("#{shared_path}/config/**/*").
                select {|p| File.file?(p) }
      paths.each do |src|
        relative_path = src.gsub(%r{.*config/},'config/')
        dest = "#{release_path}/#{relative_path}"
        # make sure the directory exist for symlink creation
        dirname = File.dirname(dest)
        FileUtils.mkdir_p(dirname) unless File.exist?(dirname)
        FileUtils.rm_rf(dest) if File.exist?(dest)
        FileUtils.ln_s(src,dest)
      end
    end
692462
function getBundlesPaths(configuration){
	// If a bundlesPath is not provided, the paths are not needed because they are
	// already set up in steal.js
	if(!configuration.loader.bundlesPath) {
		return "";
	}
	var bundlesPath = configuration.bundlesPathURL;

	// Get the dist directory and set the paths output
	var paths = util.format('\tSystem.paths["bundles/*.css"] ="%s/*css";\n' +
													'\tSystem.paths["bundles/*"] = "%s/*.js";\n',
													bundlesPath, bundlesPath);
	return "if(!System.bundlesPath) {\n" + paths + "}\n";
}
465607
function (directory) {
  try {
    const content = fs.readFileSync(path.join(directory, CONFIG_EXAMPLE_FILE), 'utf8')
    if (process.env.VERBOSE) {
      console.log('You need to configure the connector in your deepstream configuration file')
    }
    if (!process.env.QUIET) {
      console.log(`Example configuration:\n${colors.grey(content)}`)
    }
  } catch (err) {
    if (!process.env.QUIET) {
      console.log('Example configuration not found')
    }
  }
}