Platformsh\Cli\Local\Toolstack\NodeJs::build PHP Метод

build() публичный Метод

public build ( )
    public function build()
    {
        $buildDir = $this->copyToBuildDir();
        if (file_exists($buildDir . '/package.json')) {
            $this->output->writeln("Found a package.json file, installing dependencies");
            if (!$this->shellHelper->commandExists('npm')) {
                throw new DependencyMissingException('npm is not installed');
            }
            $npm = $this->shellHelper->resolveCommand('npm');
            $npmArgs = [$npm];
            if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE) {
                $npmArgs[] = '--loglevel=verbose';
            }
            $pruneArgs = $npmArgs;
            $pruneArgs[] = 'prune';
            $this->shellHelper->execute($pruneArgs, $buildDir, true, false);
            $installArgs = $npmArgs;
            $installArgs[] = 'install';
            $this->shellHelper->execute($installArgs, $buildDir, true, false);
        }
        $this->processSpecialDestinations();
    }