eventName = $this->getName(); $this ->setName('build:config_doc') ->setDescription('Step 2 (Optional): configure the documentation site for the current environment.') ->setDefinition( new InputDefinition([ new InputArgument(static::ARG_FILE, InputArgument::OPTIONAL, '', static::BUILD_NAME), ]) ) ->setHelp( <<prepare($input, $output, static::BUILD_NAME); if ($err != 0) { $output->writeln($msg); return $err; } $context = [ 'base_url' => $params['instance']['doc']['base_url'], ]; $destination = "doc/config.toml"; [$msg, $error] = $this->render($wrapper, $context, $destination); if ($error) { $output->writeln(sprintf("Failed rendering doc configuration: %s", $msg)); return 5; } $cwd = getcwd(); chdir('doc'); $err = system("hugo -D", $exit); if ($exit != 0) { $output->writeln(sprintf("Failed running hugo to rebuild documentation site: %s\n", $err)); return 6; } chdir($cwd); return 0; } }