Skip to content

Commit a20e308

Browse files
committed
Fix a few issues with the Clean task and updated a comment in the Build task.
1 parent 436be62 commit a20e308

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/Build.ps1

+7-7
Original file line numberDiff line numberDiff line change
@@ -162,26 +162,26 @@ Task Build -depends Clean, Init -requiredVariables PublishDir, Exclude, ModuleNa
162162

163163
# Get contents of the ReleaseNotes file and update the copied module manifest file
164164
# with the release notes.
165-
# DO NOT USE UNTIL UPDATE-MODULEMANIFEST IS FIXED - HORRIBLY BROKEN RIGHT NOW.
165+
# DO NOT USE UNTIL UPDATE-MODULEMANIFEST IS FIXED - DOES NOT HANDLE SINGLE QUOTES CORRECTLY.
166166
# if ($ReleaseNotesPath) {
167167
# $releaseNotes = @(Get-Content $ReleaseNotesPath)
168168
# Update-ModuleManifest -Path $PublishDir\${ModuleName}.psd1 -ReleaseNotes $releaseNotes
169169
# }
170170
}
171171

172-
Task Clean -requiredVariables PublishDir {
173-
# Sanity check the dir we are about to "clean". If $PublishDir were to
172+
Task Clean -requiredVariables PublishRootDir {
173+
# Sanity check the dir we are about to "clean". If $PublishRootDir were to
174174
# inadvertently get set to $null, the Remove-Item commmand removes the
175175
# contents of \*. That's a bad day. Ask me how I know? :-(
176-
if ($PublishRootDir.Contains($PSScriptRoot)) {
176+
if ((Test-Path $PublishRootDir) -and $PublishRootDir.Contains($PSScriptRoot)) {
177177
Remove-Item $PublishRootDir\* -Recurse -Force
178178
}
179179
}
180180

181181
Task Init -requiredVariables PublishDir {
182-
if (!(Test-Path $PublishDir)) {
183-
$null = New-Item $PublishDir -ItemType Directory
184-
}
182+
if (!(Test-Path $PublishDir)) {
183+
$null = New-Item $PublishDir -ItemType Directory
184+
}
185185
}
186186

187187
Task RemoveKey -requiredVariables EncryptedApiKeyPath {

0 commit comments

Comments
 (0)