Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ function Get-PackageDir() { ^
param([xml]$packagesXml, [string]$packagesDir, [string]$packageName); ^
ForEach ($package in $packagesXml.packages.package) { ^
if ($package.id -eq $packageName) { return Join-Path $packagesDir ($package.id + '.' + $package.version) } ^
} else { ^
Write-Host -ForegroundColor Red "ERROR: Cannot find '$packageName' package"; ^
exit 1; ^
}; ^
} ^
Write-Host -ForegroundColor Red "ERROR: Cannot find '$packageName' package"; ^
exit 1; ^
}; ^

function Test-LastExitCode { if ($LastExitCode -ne 0 -and $LastExitCode) { Write-Host "ExitCode: $LastExitCode" -ForegroundColor Red; exit $LastExitCode } }; ^
Expand All @@ -28,7 +27,7 @@ if (-not (Test-Path $NuGet)) { ^
}; ^

$PackagesDir = cmd /c "$NuGet" config RepositoryPath -AsPath; ^
if ($PackagesDir -eq '"WARNING: Key ''RepositoryPath'' not found.'") { Write-Host -ForegroundColor Red "ERROR: Cannot find 'RepositoryPath' key in NuGet.config"; exit 1 }; ^
if ($PackagesDir -eq "WARNING: Key 'RepositoryPath' not found.") { Write-Host -ForegroundColor Red "ERROR: Cannot find 'RepositoryPath' key in NuGet.config"; exit 1 }; ^

$PackagesConfig = Join-Path $WorkingDir '.nuget\packages.config'; ^
if (-not (Test-Path $PackagesConfig)) { Write-Host -ForegroundColor Red "ERROR: Cannot find solution 'packages.config'"; exit 1 }; ^
Expand All @@ -51,7 +50,7 @@ if (Test-Path $(Join-Path $WorkingDir ($BuildPackageName + '\Functions.psm1')))

Import-Module "$Psake", "$Functions"; ^
Write-Host 'Invoking psake' -ForegroundColor Cyan; ^
Invoke-psake $(Join-Path $WorkingDir '.\tasks.ps1') %*; ^
Invoke-psake $(Join-Path $WorkingDir '.\tasks.ps1'); ^

if (($psake.build_success -eq $false) -and ($LastExitCode -eq 0 -or -not ($LastExitCode))) { $LastExitCode = 1 }; ^
Test-LastExitCode;
Test-LastExitCode;