From 277d6fdd45ce872885d7901034f9ea93fd72687b Mon Sep 17 00:00:00 2001 From: Faryan Rezagholi Date: Wed, 3 Jun 2020 01:25:35 +0200 Subject: [PATCH] generate dummy html help file when python/sphinx is not set up --- Tools/sphinx_docs.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Tools/sphinx_docs.ps1 b/Tools/sphinx_docs.ps1 index 3d890f6e4..8ba3e20cf 100644 --- a/Tools/sphinx_docs.ps1 +++ b/Tools/sphinx_docs.ps1 @@ -14,10 +14,20 @@ Write-Output "Building HTML-Documentation with Sphinx" $path_HelpFilesDir = Join-Path -Path $TargetDir -ChildPath "Help" $path_SphinxSourceDir = Join-Path -Path $SolutionDir -ChildPath "mRemoteNG\Documentation" + # Remove stale Help files, if they exist if (Test-Path -Path $path_HelpFilesDir) { Remove-Item -Path $path_HelpFilesDir -Recurse -Force } + +# Build docs sphinx-build $path_SphinxSourceDir $path_HelpFilesDir +# Place dummy html file if build failed +if (-Not (Test-Path $path_HelpFilesDir\index.html -PathType Leaf)) { + New-Item -Path $path_HelpFilesDir -ItemType "directory" + New-Item $path_HelpFilesDir\index.html + Set-Content $path_HelpFilesDir\index.html 'Welcome to mRemoteNG!' +} + Write-Output "" \ No newline at end of file