/** * Execute the command. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * @return void */ public function execute(InputInterface $input, OutputInterface $output) { if (is_dir(gestao_path())) { throw new InvalidArgumentException('Gestao has already been initialized.'); } mkdir(gestao_path()); $output->writeln('<comment>Gestao initialized in:</comment> ' . gestao_path()); }
/** * Execute the command. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * * @return void */ public function execute(InputInterface $input, OutputInterface $output) { if (!is_dir(gestao_path() . '/scripts')) { mkdir(gestao_path() . '/scripts', 0777, true); copy(__DIR__ . '/scripts/gestao.rb', gestao_path() . '/scripts/gestao.rb'); copy(__DIR__ . '/scripts/serve-apache2.sh', gestao_path() . '/scripts/serve-apache2.sh'); $output->writeln('==> Gestao: Creating scripts files...'); } else { $output->writeln('==> Gestao: Scripts files...'); } }
/** * Execute the command. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * * @return void */ public function execute(InputInterface $input, OutputInterface $output) { $commands = ['composer global remove gestao-ti/console', 'composer global require gestao-ti/console']; if (!$this->installerIsUpdated() || $input->getOption('force')) { $process = new Process(implode(' && ', $commands), null, null, null, null); $process->run(function ($type, $line) use($output) { $output->write($line); }); } if ($this->rmdir(gestao_path() . '/scripts')) { (new InitCommand())->execute($input, $output); } $this->output->writeln('<info>Gestao Console up to date.</info>'); }