Skip to content

Commit

Permalink
Added check to ensure the _site directory exists before copying to it
Browse files Browse the repository at this point in the history
  • Loading branch information
NightOwl888 committed Oct 25, 2024
1 parent 5784b18 commit d1d9e7e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions websites/site/site.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ if ($Clean) {
Remove-Item (Join-Path -Path $SiteFolder "obj") -force -ErrorAction SilentlyContinue
}

if (!(Test-Path $SiteFolder)) {
New-Item $SiteFolder -ItemType Directory
}

# Copy the .htaccess & .gitattributes files to the _site directory after cleaning
Copy-Item -Path (Join-Path -Path $SiteFolder ".htaccess") -Destination (Join-Path -Path $SiteFolder "_site\.htaccess") -Force
Copy-Item -Path (Join-Path -Path $SiteFolder ".gitattributes") -Destination (Join-Path -Path $SiteFolder "_site\.gitattributes") -Force
Expand Down

0 comments on commit d1d9e7e

Please sign in to comment.