public function build() { $builder = new PharBuilder($this->config->name); foreach ($this->config->files as $file) { $builder->addFile($file, getcwd() . '/' . $file); } if ($this->config->main) { $builder->addFile($this->config->main, getcwd() . '/' . $this->config->main); $builder->mainScript($this->config->main); } $builder->build(); return $this->config->name; }
/** * @Cli("build", "Build script") * @Arg("path", OPTIONAL) */ function main($input, $output) { PharBuilder::checkCanCreatePhar(); $path = get_path($input->getArgument('path') ?: 'spec.yml'); $build = new BuildFile($path); $output->writeLn("<info>Write phar using {$path}</info>"); $output->writeLn("<info>Created " . $build->build() . "</info>"); }