Improved runtime and script classes
This commit is contained in:
@ -22,14 +22,21 @@ class RunCommand extends Command
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$env = $this->getEnvironment();
|
||||
$args = $input->getArgument('args');
|
||||
|
||||
if ($input->getOption("list")) {
|
||||
$output->writeln($env->getDefinedScripts());
|
||||
if ($input->getOption("list") || empty($input->getArgument("script"))) {
|
||||
$scripts = $env->getDefinedScripts();
|
||||
if (count($scripts) > 0) {
|
||||
$output->writeln("<options=bold>Defined scripts:</>");
|
||||
$output->writeln("- ".join("\n- ",$scripts));
|
||||
} else {
|
||||
$output->writeln("No scripts defined.");
|
||||
}
|
||||
return Command::SUCCESS;
|
||||
} elseif ($script = $input->getArgument('script')) {
|
||||
$env->runScript($script, $input->getArgument('args'), $input, $output);
|
||||
$env->runScript($script, $args, $input, $output);
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user