protected function execute(InputInterface $input, OutputInterface $output)
{
$projectRoot = $this->getProjectRoot();
if (!$projectRoot) {
throw new RootNotFoundException();
}
$dir = $projectRoot;
$subDirs = ['builds' => self::$config->get('local.build_dir'), 'local' => self::$config->get('local.local_dir'), 'shared' => self::$config->get('local.shared_dir'), 'web' => self::$config->get('local.web_root'), 'web_root' => self::$config->get('local.web_root')];
$subDir = $input->getArgument('subdir');
if ($subDir) {
if (!isset($subDirs[$subDir])) {
$this->stdErr->writeln("Unknown subdirectory: <error>{$subDir}</error>");
return 1;
}
$dir .= '/' . $subDirs[$subDir];
}
if (!is_dir($dir)) {
$this->stdErr->writeln("Directory not found: <error>{$dir}</error>");
return 1;
}
$output->writeln($dir);
return 0;
}