public function normalizeDocumentationPath($path)
{
// When running through `daux --serve` we set an environment variable to know where we started from
$env = getenv('DAUX_SOURCE');
if ($env && is_dir($env)) {
return $env;
}
if (is_dir($path)) {
if (DauxHelper::isAbsolutePath($path)) {
return $path;
}
return getcwd() . '/' . $path;
}
throw new Exception('The Docs directory does not exist. Check the path again : ' . $path);
}