Skip to content

Commit

Permalink
updating build
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Melton committed Feb 18, 2023
1 parent 8a108e4 commit 9ac2b62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#requires -Module InvokeBuild
[cmdletbinding()]
param(
[Parameter(ParameterSetName = 'docs')]
Expand Down Expand Up @@ -34,29 +35,32 @@ $staging = "$env:TEMP\dbalight_staging\"
$git = git status
if ($git[1] -notmatch "Your branch is up to date" -and (-not $PSBoundParameters.ContainsKey('PublishDocs'))) {
Pop-Location
throw "Local branch has commits not in GitHub"
throw "Local branch is dirty"
}

if (Test-Path $staging) {
Remove-Item -Recurse -Force $staging
}

if (Get-Module dbalight) {
Remove-Module dbalight -Force
}

$imported = Import-Module "$PSScriptRoot\src\dbalight.psd1" -Force -PassThru

if ($PSBoundParameters['PublishDocs']) {
if ($PSEdition -eq 'Desktop') {
Write-Warning "Doc processing has to run under PowerShell Core"
return
}
$docCommandPath = "$PSScriptRoot\docs\collections\_commands\"
$docCommandPath = "$PSScriptRoot\docs\"
Write-Host "Removing old command docs [$docCommandPath]" -ForegroundColor Black -BackgroundColor DarkCyan
Remove-Item $docCommandPath -Filter *.md -Recurse -Force -Confirm:$false -ErrorAction SilentlyContinue -Verbose

Import-Module platyPS
$cmdParams = @{
Module = $moduleName
CommandType = 'Function'
CommandType = 'Cmdlet'
}
$commands = Get-Command @cmdParams

Expand Down

0 comments on commit 9ac2b62

Please sign in to comment.