Looks for modules and configures CI
964056
private static function setupModules()
    {
        $aModuleLocations = [];

        //  Discover Nails modules
        $aModules = Components::modules();

        /**
         * Note: Key is full path, value is relative path from the application controllers
         * directory to where the modules are.
         */
        $aAbsolutePaths = [
            [rtrim(APPPATH, DIRECTORY_SEPARATOR), 'modules'],
            [rtrim(FCPATH, DIRECTORY_SEPARATOR), 'vendor', 'nails', 'common'],
        ];

        $aRelativePaths = [
            ['..', 'modules'],
            ['..', '..', 'vendor', 'nails', 'common'],
        ];

        array_walk(
            $aAbsolutePaths,
            function (&$aItem) {
                $aItem = implode(DIRECTORY_SEPARATOR, $aItem) . DIRECTORY_SEPARATOR;
            }
        );

        array_walk(
            $aRelativePaths,
            function (&$aItem) {
                $aItem = implode(DIRECTORY_SEPARATOR, $aItem) . DIRECTORY_SEPARATOR;
            }
        );

        $aModuleLocations = array_merge(
            $aModuleLocations,
            array_combine($aAbsolutePaths, $aRelativePaths)
        );

        //  Discovered Nails modules
        foreach ($aModules as $oModule) {
            $aModuleLocations[$oModule->path] = implode(
                    DIRECTORY_SEPARATOR,
                    ['..', '..', 'vendor', $oModule->name]
                ) . DIRECTORY_SEPARATOR;
        }

        // --------------------------------------------------------------------------

        /**
         * This hook happens before the config class loads (but the config file has
         * already been loaded). CI provides an interface to pass items to the config
         * file via the index.php file; we're going to leverage that here to set
         * the module locations.
         */

        //  Underscore casing is important
        global $assign_to_config;
        $key = 'modules_locations';

        if (empty($assign_to_config)) {
            $assign_to_config = [];
        }

        if (isset($assign_to_config[$key]) && is_array($assign_to_config[$key])) {

            //  Already set, merge the arrays
            $assign_to_config[$key] = array_merge($assign_to_config[$key], $aModuleLocations);

        } else {

            // Not set (or is set but not "proper", overwrite it as it's probably wrong anyway)
            $assign_to_config[$key] = $aModuleLocations;
        }
    }
1081488
function config(mode = 'production', assetDirs = [], moduleDirs = [], outputDir = false) {
  const context = resolve(__dirname, '../../../node_modules');
  const entry = _entry(Utils.castArray(assetDirs));
  const output = outputDir ? { filename: '[name].js', path: outputDir } : {};
  const removeFiles = _removeFiles(entry);
  const resolveModules = Utils.concat([context], moduleDirs);
  const devtool = mode === 'development' ? 'source-map' : false;

  return {
    mode,
    context,
    entry,
    output,
    devtool,

    module: {
      rules: [
        {
          test: /\.s[ac]ss$/,
          use: [
            { loader: MiniCssExtractPlugin.loader },
            { loader: 'css-loader', options: { url: false, sourceMap: true } },
            { loader: 'sass-loader', options: { implementation: sass, sourceMap: true } },
            { loader: 'resolve-url-loader' },
          ],
        },
      ],
    },

    plugins: [
      new MiniCssExtractPlugin({
        filename: '[name].css',
      }),
      new RemoveFilesPlugin({
        files: removeFiles,
      }),
    ],

    resolve: {
      modules: resolveModules,
    },
  };
}
523208
def packages(ciprcfg, env, opts, console):
    
    for name, source in ciprcfg.packages.items():
        console.normal('- %s' % name)

        if opts.long_details:
            console.normal('  - directory: %s' % path.join(env.package_dir, name))
            console.normal('  - source: %s' % source)
59636
def setup(self):
        
        for conf_name in self.py3_config["i3s_modules"]:
            module = I3statusModule(conf_name, self)
            self.i3modules[conf_name] = module
            if module.is_time_module:
                self.time_modules.append(module)
822854
private function prepareModulesForActivation()
    {
        $moduleDirectory = \OxidEsales\Eshop\Core\Registry::getConfig()->getModulesDir();
        $moduleList = new ModuleList();
        $moduleList->getModulesFromDir($moduleDirectory);
    }
686862
protected function configure()
    {
        $this->setName(self::COMMAND_NAME);
        $this->setDescription('Import "core_config_data" settings for an environment');
        $this->addArgument('folder', InputArgument::REQUIRED, 'Import folder name');
        $this->addArgument('environment', InputArgument::REQUIRED, 'Environment name. SubEnvs separated by slash e.g.: development/osx/developer01');
        $this->addOption('base', null, InputOption::VALUE_OPTIONAL, 'Base folder name', 'base');
        $this->addOption('format', 'm', InputOption::VALUE_OPTIONAL, 'Format: yaml, json (Default: yaml)', 'yaml');

        parent::configure();
    }
810989
def install(args, console, env, ciprcfg, opts):
    
    if len(args) == 0:
        # Is this a cipr project?
        if ciprcfg.exists:
            # Install all the packages for this project
            console.quiet('Installing current project packages...')
            for name, source in ciprcfg.packages.items():
                if opts.upgrade:
                    app.command.run(['install', '--upgrade', source])
                else:
                    app.command.run(['install', source])
        else:
            console.error('No cipr project or package found.')
        return
    else:
        for source in args:
            package, name, version, type = _package_info(source)

            if not path.exists(env.package_dir):
                os.makedirs(env.package_dir)

            package_dir = path.join(env.package_dir, name)

            if path.exists(package_dir):
                if opts.upgrade:
                    app.command.run(['uninstall', name])
                else:
                    console.quiet('Package %s already exists. Use --upgrade to force a re-install.' % name)
                    return

            console.quiet('Installing %s...' % name)


            if type == 'git':
                tmpdir = tempfile.mkdtemp(prefix='cipr')
                clom.git.clone(package, tmpdir).shell.execute()

                if version:
                    cmd = AND(clom.cd(tmpdir), clom.git.checkout(version))
                    cmd.shell.execute()

                package_json = path.join(tmpdir, 'package.json')
                if path.exists(package_json):
                    # Looks like a cipr package, copy directly
                    shutil.move(tmpdir, package_dir)
                else:
                    # Not a cipr package, sandbox in sub-directory
                    shutil.move(tmpdir, path.join(package_dir, name))

                console.quiet('`%s` installed from git repo to `%s`' % (name, package_dir))

            elif path.exists(package):
                # Local
                os.symlink(package, package_dir)
            else:
                console.error('Package `%s` type not recognized' % package)
                return

            pkg = Package(package_dir, source)
            ciprcfg.add_package(pkg)

            if pkg.dependencies:
                console.quiet('Installing dependancies...')
                for name, require in pkg.dependencies.items():
                    if opts.upgrade:
                        app.command.run(['install', '--upgrade', require])
                    else:
                        app.command.run(['install', require])
1340215
def build(env, ciprcfg, console):
    
    os.putenv('CIPR_PACKAGES', env.package_dir)
    os.putenv('CIPR_PROJECT', env.project_directory)

    build_settings = path.join(env.project_directory, 'build.settings')

    with open(build_settings, 'r') as f:
        data = f.read()

    m = _build_re.search(data)
    if m:
        ver = int(m.group(2))
        data = data.replace(m.group(0), 'CFBundleVersion = "%d"' % (ver + 1))

        with open(build_settings, 'w') as f:
            f.write(data)


    if path.exists(env.build_dir):
        shutil.rmtree(env.build_dir)

    os.makedirs(env.build_dir)

    if path.exists(env.dist_dir):
        shutil.rmtree(env.dist_dir)

    os.makedirs(env.dist_dir)

    console.normal('Building in %s' % env.build_dir)

    console.normal('Copy project files...')
    for src, dst in util.sync_dir_to(env.project_directory, env.build_dir, exclude=['.cipr', '.git', 'build', 'dist', '.*']):
        console.quiet('  %s -> %s' % (src, dst))
        if src.endswith('.lua'):
            _fix_lua_module_name(src, dst)


    console.normal('Copy cipr packages...')
    for package in ciprcfg.packages.keys():
        for src, dst in util.sync_lua_dir_to(path.join(env.package_dir, package), env.build_dir, exclude=['.git'], include=['*.lua']):
            console.quiet('  %s -> %s' % (src, dst))
            if src.endswith('.lua'):
                _fix_lua_module_name(src, dst)

    src = path.join(env.code_dir, 'cipr.lua')
    dst = path.join(env.build_dir, 'cipr.lua')
    shutil.copy(src, dst)

    cmd = AND(clom.cd(env.build_dir), clom[CORONA_SIMULATOR_PATH](env.build_dir))

    console.normal('Be sure to output your app to %s' % env.dist_dir)

    try:
        cmd.shell.execute()
    except KeyboardInterrupt:
        pass
1197
private function addModuleRules()
	{
		// Load the routes from cache
		$moduleRoutes = array();
		$directories = glob(Yii::getPathOfAlias('application.modules') . '/*' , GLOB_ONLYDIR);

		foreach ($directories as $dir)
		{
			$routePath = $dir .DS. 'config' .DS. 'routes.php';
			if (file_exists($routePath))
			{
				$routes = require_once($routePath);
				// Unit tests are failing here for some reason
				if (!is_array($routes))
					continue;

				foreach ($routes as $k=>$v)
				$moduleRoutes[$k] = $v;
			}
		}

		return $moduleRoutes;
	}
990293
def cli(ctx, config, debug):
    """"""
    ctx.obj['config'] = config
    ctx.obj['engine'] = stex.SnakeTeX(config_file=config, debug=debug)
119477
function installGitDependencies(options, cb) {
  var libsassPath = './src/libsass';

  if (process.env.LIBSASS_EXT || options.libsassExt) {
    cb();
  } else if (fs.access) { // node 0.12+, iojs 1.0.0+
    fs.access(libsassPath, fs.R_OK, function(err) {
      err && err.code === 'ENOENT' ? initSubmodules(cb) : cb();
    });
  } else { // node < 0.12
    fs.exists(libsassPath, function(exists) {
      exists ? cb() : initSubmodules(cb);
    });
  }
}
945949
function setupSystemD (name, options, callback) {
  options.stdOut = (options.logDir && `${options.logDir}/${name}-out.log`) || null
  options.stdErr = (options.logDir && `${options.logDir}/${name}-err.log`) || null

  const filepath = `/etc/systemd/system/${name}.service`

  const script = systemdTemplate(options)

  if (options.dryRun) {
    console.log(script)
    return
  }

  console.log(`Installing service on: ${filepath}`)
  fs.exists(filepath, exists => {
    if(!exists) {
      fs.writeFile(filepath,script, err => {
        if (err) {
          callback(err)
          return
        }

        fs.chmod(filepath,'755', err => {
          if (err) {
            callback(err)
            return
          }

          let cmd = 'systemctl daemon-reload'
          console.log('Running %s...', cmd)
          exec(cmd, err => {
            callback(err, 'SystemD service registered succesfully')
          })
        })
      })
    } else {
      callback('Service already exists, please uninstall first')
    }
  })
}
1028123
function tree (dir, opts, cb) {
  var i = 0
  findPackage(dir, function (err, pkg) {
    pull(
      pull.depthFirst(pkg, function (pkg) {
        pkg.tree = {}
        return pull(
          pfs.readdir(path.resolve(pkg.path, 'node_modules')),
          paramap(maybe(readPackage)),
          pull.filter(function (_pkg) {
            if(!_pkg) return
            _pkg.parent = pkg
            
            pkg.tree[_pkg.name] = _pkg
            return pkg
          })
        )
      }),
      opts.post ? paramap(function (data, cb) {
        //run a post install-style hook.
        opts.post(data, cb)
      }) : pull.through(),
      pull.drain(null, function (err) {
        cb(err === true ? null : err, clean(pkg))
      })
    )
  })
}
1238401
function installModule(nodeModules, dep, opts, cb) {
    var where = path.join(nodeModules, '..');

    console.log('installing ', where, dep.resolved);
    var cmd = 'npm install ' + dep.resolved;

    if (opts.registry) {
        cmd += ' --registry=' + opts.registry;
    }

    exec(cmd, {
        cwd: where
    }, cb);
}
1134533
def sysinit(systype, conf, project):
    """"""

    click.secho(get_config(
        systype,
        conf=ConfModule(conf).configurations[0],
        conf_path=conf,
        project_name=project,
    ))
943405
public static function install()
    {
        static::updatePackages();
        static::updateBootstrapping();

        tap(new Filesystem, function ($filesystem) {
            $filesystem->deleteDirectory(resource_path('js/components'));
            $filesystem->delete(resource_path('sass/_variables.scss'));
            $filesystem->deleteDirectory(base_path('node_modules'));
            $filesystem->deleteDirectory(public_path('css'));
            $filesystem->deleteDirectory(public_path('js'));
        });
    }
805473
def _parser_options():
    """"""
    import argparse
    parser = argparse.ArgumentParser(description="UNCLE Cron Server")
    parser.add_argument("-examples", action="store_true",
                        help="Display examples of how to use this script.")
    parser.add_argument("-setup", action="store_true",
                        help=("Setup the cron tab and script database for this server so "
                              "that it is ready to have repositories installed."))
    parser.add_argument("-rollback", action="store_true",
                        help=("Remove this script's cron tab and reverse other things done "
                              "by this script. This does not delete this script."))
    parser.add_argument("-enable", action="store_true",
                        help="Re-enable the continuous integration server.")
    parser.add_argument("-disable", action="store_true",
                        help=("Disable the continuous integration server so that it no longer "
                              "monitors the installed repositories."))
    parser.add_argument("-cron", action="store_true",
                        help=("Run the continuous integration routines for all the repos installed "
                              "in this script's database."))
    parser.add_argument("-list", action="store_true",
                        help="List all the repositories in the CI server's database.")
    parser.add_argument("-install", nargs="+",
                        help=("Install the specified XML file(s) as repositories to be monitored "
                              "by the CI server."))
    parser.add_argument("-uninstall", nargs="+",
                        help=("Uninstall the specified XML file(s) as repositories from "
                              "the CI server."))
    parser.add_argument("--verbose", nargs="?", type=int, const=1,
                        help="Runs the CI server in verbose mode.")
    parser.add_argument("-cronfreq", type=int, default=1,
                        help="Specify the frequency at which the cron runs.")
    parser.add_argument("-nolive", action="store_true",
                        help=("For unit testing, when specified no live requests are made to "
                              "servers and all the class actions are performed in test mode. "
                              "This also prevents the cron tab from being installed."))

    global args
    args = vars(parser.parse_known_args()[0])

    if args["examples"]:
        examples()
        exit(0)

    return args