Skip to content

Commit

Permalink
Remove packages dir if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunLawrie committed Oct 23, 2023
1 parent d8b8e0f commit 008385b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PwshSpectreConsole/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ function Install-SpectreConsole {
[string] $InstallLocation,
[string] $Version
)

New-Item -Path $libPath -ItemType "Directory" -Force | Out-Null

$libPath = Join-Path $InstallLocation "Spectre.Console"
New-Item -Path $libPath -ItemType "Directory" -Force | Out-Null
$downloadLocation = Join-Path $libPath "download.zip"
Expand Down Expand Up @@ -35,5 +38,7 @@ function Install-SpectreConsole {

Write-Host "Downloading Spectre.Console version $Version"
$installLocation = (Join-Path $PSScriptRoot "packages")
Remove-Item $installLocation -Recurse -Force
if(Test-Path $installLocation) {
Remove-Item $installLocation -Recurse -Force
}
Install-SpectreConsole -InstallLocation $installLocation -Version $Version

0 comments on commit 008385b

Please sign in to comment.