diff --git a/build.ps1 b/build.ps1 index 40b4d740..1287451b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -158,14 +158,15 @@ if(-Not $SkipToolPackageRestore.IsPresent) { if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or ($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) { Write-Verbose -Message "Missing or changed package.config hash..." - Remove-Item * -Recurse -Exclude packages.config,nuget.exe + Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery | + Remove-Item -Recurse } Write-Verbose -Message "Restoring tools from NuGet..." $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`"" if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet tools." + Throw "An error occurred while restoring NuGet tools." } else { @@ -185,7 +186,7 @@ if (Test-Path $ADDINS_PACKAGES_CONFIG) { $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`"" if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet addins." + Throw "An error occurred while restoring NuGet addins." } Write-Verbose -Message ($NuGetOutput | out-string) @@ -202,7 +203,7 @@ if (Test-Path $MODULES_PACKAGES_CONFIG) { $NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`"" if ($LASTEXITCODE -ne 0) { - Throw "An error occured while restoring NuGet modules." + Throw "An error occurred while restoring NuGet modules." } Write-Verbose -Message ($NuGetOutput | out-string) @@ -231,4 +232,4 @@ $cakeArguments += $ScriptArgs # Start Cake Write-Host "Running build script..." &$CAKE_EXE $cakeArguments -exit $LASTEXITCODE +exit $LASTEXITCODE \ No newline at end of file