protected function createRouter($projectRoot)
    {
        static $created = [];

        $router_src = CLI_ROOT . '/resources/router/router.php';
        if (!file_exists($router_src)) {
            throw new \RuntimeException(sprintf('Router not found: <error>%s</error>', $router_src));
        }

        $router = $projectRoot . '/' . $this->config()->get('local.local_dir') . '/' . basename($router_src);
        if (!isset($created[$router])) {
            if (!file_put_contents($router, file_get_contents($router_src))) {
                throw new \RuntimeException(sprintf('Could not create router file: <error>%s</error>', $router));
            }
            $created[$router] = true;
        }

        return $router;
    }