Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 0aa19f2

Browse files
committed
Fix bootstrapperto use cake.pacakges.config
1 parent d4b66df commit 0aa19f2

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

build.ps1

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ $PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
106106
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
107107
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
108108
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"
109+
$CAKE_PACKAGES_CONFIG = Join-Path $PSScriptRoot "cake.packages.config"
109110

110111
# Make sure tools folder exists
111112
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
@@ -115,11 +116,16 @@ if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
115116

116117
# Make sure that packages.config exist.
117118
if (!(Test-Path $PACKAGES_CONFIG)) {
118-
Write-Verbose -Message "Downloading packages.config..."
119-
try {
120-
$wc = GetProxyEnabledWebClient
121-
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
122-
Throw "Could not download packages.config."
119+
if (!(Test-Path $CAKE_PACKAGES_CONFIG)) {
120+
Write-Verbose -Message "Downloading packages.config..."
121+
try {
122+
$wc = GetProxyEnabledWebClient
123+
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
124+
Throw "Could not download packages.config."
125+
}
126+
} else {
127+
Write-Verbose -Message "using local cake.packages.config..."
128+
Copy-Item $CAKE_PACKAGES_CONFIG $PACKAGES_CONFIG
123129
}
124130
}
125131

@@ -232,4 +238,4 @@ $cakeArguments += $ScriptArgs
232238
# Start Cake
233239
Write-Host "Running build script..."
234240
&$CAKE_EXE $cakeArguments
235-
exit $LASTEXITCODE
241+
exit $LASTEXITCODE

0 commit comments

Comments
 (0)