Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Path instead of Paths
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmEmanuel authored Jan 6, 2024
1 parent 8066412 commit 466fa3e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .build/tasks/BicepNet.build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
param (
[string[]]
$Paths = @('BicepNet.Core', 'BicepNet.PS'),
$Path = @('BicepNet.Core', 'BicepNet.PS'),

[ValidateSet('Debug', 'Release')]
[string]
Expand All @@ -22,23 +22,23 @@ task dotnetBuild {
dotnet build-server shutdown
}

foreach ($path in $Paths) {
$outPathFolder = Split-Path -Path (Resolve-Path -Path $path) -Leaf
Write-Host $Path
foreach ($projPath in $Path) {
$outPathFolder = Split-Path -Path (Resolve-Path -Path $projPath) -Leaf
Write-Host $projPath
Write-Host $outPathFolder
$outPath = "bin/$outPathFolder"
if (-not (Test-Path -Path $path)) {
throw "Path '$path' does not exist."
if (-not (Test-Path -Path $projPath)) {
throw "Path '$projPath' does not exist."
}

Push-Location -Path $path
Push-Location -Path $projPath

# Remove output folder if exists
if (Test-Path -Path $outPath) {
Remove-Item -Path $outPath -Recurse -Force
}

Write-Host "Building '$path' to '$outPath'" -ForegroundColor 'Magenta'
Write-Host "Building '$projPath' to '$outPath'" -ForegroundColor 'Magenta'
dotnet publish -c $Configuration -o $outPath

# Remove everything we don't need from the build
Expand Down

0 comments on commit 466fa3e

Please sign in to comment.