Skip to content

Commit f847e2f

Browse files
committed
Fix BuildDocs.ps1 -Publish error
This change fixes an issue with the BuildDocs.ps1 script that causes it to throw an error when Remove-Item is called to delete the old documentation repo folder. It now uses Test-Path to check for the folder's existence before attempting to delete it.
1 parent 15d866e commit f847e2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/BuildDocs.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ else {
3636

3737
if ($Publish.IsPresent) {
3838
# Delete the existing docs repo folder
39-
Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null
39+
if (Test-Path $docsRepoPath) {
40+
Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null
41+
}
4042

4143
# Clone the documentation site branch of the Editor Services repo
4244
git clone -b gh-pages https://github.com/PowerShell/PowerShellEditorServices.git $docsRepoPath

0 commit comments

Comments
 (0)