Build and install frontend
350890
def frontend(ctx, dev, rebuild, no_install, build_type):
    """"""

    install_frontend(instance=ctx.obj['instance'],
                     forcerebuild=rebuild,
                     development=dev,
                     install=not no_install,
                     build_type=build_type)
492505
public function build()
    {
        $this->app->writeln("\n<comment>Adding root pages</comment>");
        $this->addPages('\\Skosh\\Content\\Page');

        $this->app->writeln("\n<comment>Adding posts</comment>");
        $this->addPages('\\Skosh\\Content\\Post', 'path', '_posts');

        $this->app->writeln("\n<comment>Adding docs</comment>");
        $this->addPages('\\Skosh\\Content\\Doc', 'path', '_doc');

        // Sort pages
        $this->sortPosts();

        // Fire event
        Event::fire('pages.sorted', [$this]);

        $this->app->writeln("\n<comment>Rendering content</comment>");

        foreach ($this->site->pages as $content) {
            $this->renderContent($content);
        }

        // Fire event
        Event::fire('pages.rendered', [$this]);
    }
584212
public function react()
    {
        (new Presets\React($this->filesystem))->install();
        $this->info('React scaffolding installed successfully.');
        $this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
    }
489201
public function install()
    {
        if ($this->request->data()) {
            $task = false;
            $uploadError = false;

            if (isset($this->request->data['download'])) {
                $task = (bool)WebShellDispatcher::run("Installer.plugins install -s \"{$this->request->data['url']}\" --theme -a");
            } elseif (isset($this->request->data['file_system'])) {
                $task = (bool)WebShellDispatcher::run("Installer.plugins install -s \"{$this->request->data['path']}\" --theme -a");
            } else {
                $uploader = new PackageUploader($this->request->data['file']);
                if ($uploader->upload()) {
                    $task = (bool)WebShellDispatcher::run('Installer.plugins install -s "' . $uploader->dst() . '" --theme -a');
                } else {
                    $uploadError = true;
                    $this->Flash->set(__d('system', 'Plugins installed but some errors occur'), [
                        'element' => 'System.installer_errors',
                        'params' => ['errors' => $uploader->errors(), 'type' => 'warning'],
                    ]);
                }
            }

            if ($task) {
                $this->Flash->success(__d('system', 'Theme successfully installed!'));
                $this->redirect($this->referer());
            } elseif (!$task && !$uploadError) {
                $this->Flash->set(__d('system', 'Theme could not be installed'), [
                    'element' => 'System.installer_errors',
                    'params' => ['errors' => WebShellDispatcher::output()],
                ]);
            }
        }

        $this->title(__d('system', 'Install Theme'));
        $this->Breadcrumb
            ->push('/admin/system/themes')
            ->push(__d('system', 'Install new theme'), '#');
    }
1184266
public function install()
	{
		parent::install();

		$Eresus = Eresus_CMS::getLegacyKernel();
		if (!is_dir($Eresus->froot.'templates/'.$this->name))
		{
			$umask = umask(0000);
			mkdir($Eresus->froot.'templates/'.$this->name, 0777);
			umask($umask);
		}
	}
109999
def _build_backend():
    """"""
    ep = os.environ['PEP517_BUILD_BACKEND']
    mod_path, _, obj_path = ep.partition(':')
    try:
        obj = import_module(mod_path)
    except ImportError:
        raise BackendUnavailable
    if obj_path:
        for path_part in obj_path.split('.'):
            obj = getattr(obj, path_part)
    return obj
505063
def update(ctx, no_restart, no_rebuild):
    """"""

    # 0. (NOT YET! MAKE A BACKUP OF EVERYTHING)
    # 1. update repository
    # 2. update frontend repository
    # 3. (Not yet: update venv)
    # 4. rebuild frontend
    # 5. restart service

    instance = ctx.obj['instance']

    log('Pulling github updates')
    run_process('.', ['git', 'pull', 'origin', 'master'])
    run_process('./frontend', ['git', 'pull', 'origin', 'master'])

    if not no_rebuild:
        log('Rebuilding frontend')
        install_frontend(instance, forcerebuild=True, install=False, development=True)

    if not no_restart:
        log('Restaring service')
        if instance != 'hfos':
            instance = 'hfos-' + instance

        run_process('.', ['sudo', 'systemctl', 'restart', instance])

    log('Done')
233863
function setup() {
  if (!fileExists(settingsPath)) {
    buildSettings();
  }

  var settings = fs.readFileSync(settingsPath, 'utf8');
  settings = JSON.parse(settings);

  if (!settings.tfPath || !settings.vsArchitecture || !settings.vsVersion) {
    buildSettings();
  }

  // Rebuild settings if TF.exe has been uninstalled/updated
  if (!fileExists(settings.tfPath)) {
    buildSettings();
  }

  return settings;
}
956272
public function build()
    {
        $tokenParsers = [];
        $executionStrategies = [];
        $functions = [];

        foreach ($this->extensions as $extension) {
            $tokenParsers = array_merge($tokenParsers, $extension->getTokenParsers());
            $executionStrategies = array_merge($executionStrategies, $extension->getExecutionStrategies());
            $functions = array_merge($functions, $extension->getFunctions());
        }

        $registry = new Registry($tokenParsers, [], [], '<{', '}>');

        $this->syntax = new Syntax(new Lexer(new TemplateLexer($registry)), new Parser(new TemplateParser($registry)));

        $this->executionStrategies = new ExecutionStrategyCollection($executionStrategies);

        $this->environment = new Environment($functions);

        $this->isLocked = true;
    }
170398
public function main()
    {
        if ($this->composer === null) {
            $this->findComposer();
        }

        $files = array();
        if (!empty($this->file) && file_exists($this->file)) {
            $files[] = $this->file;
        }

        if (!empty($this->dir)) {
            $found = $this->findFiles();
            foreach ($found as $file) {
                $files[] = $this->dir . DIRECTORY_SEPARATOR . $file;
            }
        }

        foreach ($files as $file) {

            $cmd = $this->composer . ' validate ' . $file;
            $cmd = escapeshellcmd($cmd);

            if ($this->passthru) {
                $retval = null;
                passthru($cmd, $retval);
                if ($retval == 1) {
                    throw new BuildException('invalid composer.json');
                }
            } else {
                $out = array();
                $retval = null;
                exec($cmd, $out, $retval);
                if ($retval == 1) {
                    $err = join("\n", $out);
                    throw new BuildException($err);
                } else {
                    $this->log($out[0]);
                }
            }

        }

    }
88745
function build() { 

    module.el.find('.ple-module-content').append('<div style="display:none;" class="ple-title-related"></div>');
    relatedEl = module.el.find('.ple-title-related');
    relatedEl.append('<p class="ple-help">Does your work relate to one of these? Click to alert those contributors.</p><hr style="margin: 4px 0;" />');

  }
274829
function install(args, cb) {
  args = ['install', '--save-dev'].concat(args);
  utils.spawn('npm', args, {stdio: 'inherit'})
    .on('error', cb)
    .on('close', function(code, err) {
      cb(err, code);
    });
}
1159669
function boot() {
        // load dependencies
        cli = cli || define.cache.get(MODULE_ID_CLI, "minor").factory();

        var nw;
        var ui;
        try {
            // listen for OS open file event
            nw = require("nw");
            ui = require("nw.gui");
        }
        catch(e) {
            // ignore
        }

        // specify cli options
        if (nw) {
            cli.option("--ui", "Opens the selector in nw.js.");
        }
        else if (!host.isRuntimeBrowserFamily()) {
            cli.option("--ui", MSG_UI_UNAVAILABLE);
        }
        if (host.runtime == host.RUNTIME_NODEJS) {
            cli.option("--debug [port]", "Starts node.js in debug mode.");
        }
        else {
            cli.option("--debug [port]", MSG_DEBUG_UNAVAILABLE);
        }
        cli.option("--repo <url>", "Overrides the main repository for the active profile.");
        if (host.isRuntimeBrowserFamily()) {
            cli.option("--theme <url>", "Loads the specified css theme.");
        }
        cli.option("--config <json>", "A JSON object with parameters for the package module loaded.");
        cli.option("--profile <name>", "Overrides the active profile.");
        cli.option("--gh-username <username>", "Overrides the global configuration GitHub username key.");
        cli.option("--gh-password <password>", "Overrides the global configuration GitHub password key.");
        cli.option("--gh-token <token>", "Overrides the global configuration GitHub token key.");
        cli.option("--gh-branch <branch>", "Overrides the global configuration GitHub branch key.");
        cli.option("--gh-enable-pre-release <enable>", "Overrides the global configuration GitHub enable pre-release key.");
        cli.command("profile", "Performs configuration profile operations.")
            .command("list", "Lists all of the profiles available in the configuration.")
            .action(profileList);
        cli.command("profile")
            .command("add <name>", "Add a new profile.")
            .action(profileAdd);
        cli.command("profile")
            .command("copy <name>", "Creates a copy of the current profile with the given name.")
            .action(profileCopy);
        cli.command("profile")
            .command("remove <name>", "Removes the profile with the given name.")
            .action(profileRemove);
        cli.command("profile")
            .command("current", "Displays the name of the active profile.")
            .action(profileCurrent);
        cli.command("profile")
            .command("switch <name>", "Activates the profile with the given name.")
            .action(profileSwitch);
        cli.command("profile")
            .command("set <section> <key> <value>", "Sets the key value combination in the active profile.")
            .action(profileSet);
        cli.parameter("allume <selector>");
        var p = cli.parse(allume.parameters);

        //
        // start the loading process for the specified selector
        //
        function open(selector) {
            if (p["--debug"] && host.runtime == host.RUNTIME_NODEJS) {
                return debug(p);
            }
            if (p["--ui"] && !ui) {
                if (!nw) {
                    allume.update(allume.STATUS_ERROR, MSG_UI_UNAVAILABLE);
                    return;
                }

                // spawn nw.js process for allume with parameters
                var findpath = nw.findpath;
                childProcess = childProcess || require("child_process");
                path = path || require("path");

                var PATH_NW = findpath();
                var PATH_APP = path.join(__dirname, "..");
                var PATH_CWD = process.cwd();
                var env = Object.create(process.env);
                env.PWD = process.cwd();

                process.argv.splice(1, 1);
                process.argv[0] = PATH_APP;
                for (var a in process.argv) {
                    process.argv[a] = process.argv[a].replace(/"/g, "\"");
                }

                var ls = childProcess.spawn(PATH_NW, process.argv, {"cwd": PATH_CWD, "env" : env});

                ls.stdout.on("data", function(data) {
                    console.log(data.toString().trim());
                });

                ls.stderr.on("data", function(data) {
                    console.error(data.toString().trim());
                });

                return;
            }

            var requests = [];
            var request = selector;
            if (p["--config"]) {
                var json;
                try {
                    json = JSON.parse(p["--config"].json);
                }
                catch(e) {
                    var e = new Error("Make sure the data you pass to the --config switch is valid JSON data.");
                    e.name = "error-invalid-configuration";
                    if (typeof document !== "undefined" && firstOpen) {
                        allume.update(e);
                    }
                    else {
                        console.error(e);
                    }
                    firstOpen = false;
                    return;
                }
                request = { "package" : selector, "configuration" : json };
            }
            requests.push(request);

            if (requests) {
                using.apply(using, requests).then(function () {
                    if (firstOpen) {
                        allume.hide();
                        firstOpen = false;
                    }
                }, function (loader) {
                    usingFailed(loader);
                    var e = new Error(err);
                    e.name = errName;
                    if (typeof document !== "undefined" && firstOpen) {
                        allume.update(e);
                        firstOpen = false;
                    }
                    else {
                        console.error(e);
                    }
                });
            }
        }

        if (p) {
            // attach config function to allume
            allume.config = config;

            // process commands and options
            if (p.repo) {
                repo = p.repo;
            }
            if (p["--profile"]) {
                allume.update(allume.STATUS_ERROR, MSG_MISSING_FEATURE);
                profile = p.profile;
            }
            if (p["--theme"] && typeof document !== "undefined") {
                var theme = document.createElement("link");
                theme.rel = "stylesheet";
                theme.href = p["--theme"].url;
                document.head.appendChild(theme);
            }
            if (p["--gh-username"]) {
                config.github = config.github || {};
                config.github.username = p["--gh-username"].username;
            }
            if (p["--gh-password"]) {
                config.github = config.github || {};
                config.github.password = p["--gh-password"].password;
            }
            if (p["--gh-token"]) {
                config.github = config.github || {};
                config.github.token = p["--gh-token"].token;
            }
            if (p["--gh-branch"]) {
                config.github = config.github || {};
                config.github.branch = p["--gh-branch"].branch;
            }
            if (p["--gh-enable-pre-release"]) {
                var val = p["--gh-enable-pre-release"].enable;
                config.github = config.github || {};
                config.github.enablePreRelease = !(val == "false" || !val);
            }
            if (p["--help"]) {
                if (typeof document !== "undefined") {
                    var e = new Error(p["--help"]);
                    e.name = "help";
                    allume.update(e);
                }
            }
            else if (!p.selector && !p.profile && (!p["--ui"] || ui)) {
                if (host.isRuntimeBrowserFamily() && !host.isRuntimeNodeFamily()) {
                    //debug
                    window.location = "../about.html";
                }
                else {
                    var e = new Error("The boot sequence can't start because no package was specified. If you are the developer of the app using allume, then please make sure you specify the package to load.");
                    e.name = "error-invalid-package";
                    if (typeof document !== "undefined") {
                        allume.update(e);
                    }
                    else {
                        console.error(e);
                    }
                }
            }
            else if (p.selector || p["--ui"]) {
                if (ui) {
                    // listen for OS open file event
                    ui.App.on("open", function(cmdline) {
                        cmdline = cmdline.replace(/"([^"]+)"/g, function(a) {
                            return a.replace(/\s/g, "&nbsp;");
                        }).split(" ");
                        for (var i = 0, length = cmdline.length, arg = "", args = []; i < length; ++i) {
                            arg = cmdline[i].replace(/&nbsp;/g, " ");
                            // filter by exe file and exe args.
                            if (arg === "\"" + process.execPath + "\"" || arg.search(/^\-\-/) === 0) continue;
                            args.push(arg);
                        }
                        console.log("OPEN", args);
                        open(args[args.length -1]);
                    });
                }

                open(p.selector);
            }
        }
        else {
            if (typeof document !== "undefined") {
                var e = new Error("Parameters where missing or invalid. Please check your browser javascript console.");
                e.name = "error-invalid-parameter";
                allume.update(e);
            }
        }
    }
1282864
def build_install(self):
        
        slackbuilds = self.dependencies + self.master_packages
        installs, upgraded, = [], []
        if not os.path.exists(self.build_folder):
            os.makedirs(self.build_folder)
        if not os.path.exists(self._SOURCES):
            os.makedirs(self._SOURCES)
        os.chdir(self.build_folder)
        for prgnam in slackbuilds:
            if (self.meta.not_downgrade == "on" and
                    self.not_downgrade(prgnam) is True):
                continue
            pkg = "-".join(prgnam.split("-")[:-1])
            installed = "".join(find_package(prgnam, self.meta.pkg_path))
            src_link = SBoGrep(pkg).source().split()
            if (installed and "--download-only" not in self.flag and
                    "--rebuild" not in self.flag):
                self.msg.template(78)
                self.msg.pkg_found(prgnam)
                self.msg.template(78)
            elif self.unst[0] in src_link or self.unst[1] in src_link:
                self.msg.template(78)
                print("| Package {0} {1}{2}{3}".format(
                    prgnam, self.meta.color["RED"], "".join(src_link),
                    self.meta.color["ENDC"]))
                self.msg.template(78)
            else:
                sbo_url = sbo_search_pkg(pkg)
                sbo_link = SBoLink(sbo_url).tar_gz()
                script = sbo_link.split("/")[-1]
                if self.meta.sbosrcarch in ["on", "ON"]:
                    src_link = self.sbosrcarsh(prgnam, sbo_link, src_link)
                Download(self.build_folder, sbo_link.split(),
                         repo="sbo").start()
                Download(self._SOURCES, src_link, repo="sbo").start()
                if "--download-only" in self.flag:
                    continue
                sources = self.filenames(src_link)
                BuildPackage(script, sources, self.build_folder,
                             auto=False).build()
                binary = slack_package(prgnam)
                if os.path.isfile("".join(binary)):
                    if GetFromInstalled(pkg).name() == pkg:
                        print("[ {0}Upgrading{1} ] --> {2}".format(
                            self.meta.color["YELLOW"],
                            self.meta.color["ENDC"], prgnam))
                        upgraded.append(prgnam)
                    else:
                        print("[ {0}Installing{1} ] --> {2}".format(
                            self.meta.color["GREEN"],
                            self.meta.color["ENDC"], prgnam))
                        installs.append(prgnam)
                    if ("--rebuild" in self.flag and
                            GetFromInstalled(pkg).name() == pkg):
                        PackageManager(binary).upgrade(flag="--reinstall")
                    else:
                        PackageManager(binary).upgrade(flag="--install-new")
        return installs, upgraded
249781
def build():
    
    test_files()
    with open('content.rst') as f:
        content = publish_parts(f.read(), writer_name='html')
        title = content['title']
        body =  content['html_body'].replace('\n',' ')

    with open('template.jinja', 'r') as f:
        loader = FileSystemLoader(getcwd())
        env= Environment(loader=loader)
        template = env.get_template('template.jinja')
        page =  template.render(title=title,
                                content=body)

    with open('index.html', 'w') as f:
        f.write(page)
69259
protected function install()
    {
        $this->setupCore();
        $this->setupBackend();
        $this->initializeDatabase();
        $this->runCommand('cache:clear', array('--no-warmup' => true));
    }
856593
public function install()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        $this->info('Publishing required files', 1);
        $this->call('vendor:publish', ['--provider' => TwoStreamServiceProvider::class, '--tag' => ['required']], 2);
        
        $this->info('Applying your app\'s namespace <comment>[' . $this->appNamespace . ']</comment>', 1);
        foreach (TwoStreamServiceProvider::pathsToPublish(TwoStreamServiceProvider::class, 'required') as $required) {
            $required = str_replace(app_path(), '', $required);
            $originalFile = $disk->get($required);
            $file = str_replace('{{namespace}}', $this->appNamespace, $originalFile);
            
            if ($file != $originalFile) {
                $this->info('Setting namespace for <comment>[/app' . str_replace([app_path(), '.php', '.stub'], '', $required) . ']</comment>', 2);
                $disk->put($required, $file);
            }
            
            if (! $disk->exists(str_replace('.stub', '.php', $required))) {
                $disk->move($required, str_replace('.stub', '.php', $required));
            }
        }
        
        $this->info('Cleaning up...', 1);
        $this->level(0);
        $files = array_merge($disk->allFiles('Ws'), $disk->allFiles('Exceptions'));
        foreach ($files as $key => $file) {
            if (preg_match('/\\.stub$/', $file)) {
                $disk->delete($file);
            }
        }
    }