forked from spectresystems/spectre.cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
34 lines (29 loc) · 966 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[CmdletBinding()]
Param(
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
# Get the script root folder.
if(!$PSScriptRoot) {
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
# Create the tools folder.
$Tools = Join-Path $PSScriptRoot "tools"
if (!(Test-Path $Tools)) {
New-Item -Path $Tools -ItemType Directory | Out-Null
}
# Make sure that cakeup is present.
$Cakeup = Join-Path $Tools "cakeup-x86_64-latest.exe"
if (!(Test-Path $Cakeup)) {
Write-Host "Downloading cakeup.exe..."
try {
$wc = (New-Object System.Net.WebClient);
$wc.DownloadFile("https://cakeup.blob.core.windows.net/windows/cakeup-x86_64-latest.exe", $Cakeup) } catch {
Throw "Could not download cakeup.exe."
}
}
# Execute Cakeup
&$Cakeup "run" "--cake=0.30.0" "--sdk=2.1.400" `
"--execute" "--" $ScriptArgs
# Return the exit code from Cakeup.
exit $LASTEXITCODE;