-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.ps1
72 lines (61 loc) · 2.03 KB
/
install.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<#
.DESCRIPTION
Deprecated Installation Bootstrap
.Notes
This file only exists for backwards compatibility reasons. Cannot be deleted. Should not be modified.
#>
param(
[Parameter(
Mandatory = $false
)]
[string]$version = "develop" ## use latest if no version was given
, [Parameter(
Mandatory = $false
)]
[string]$repo_url = "https://github.com/avengineers/SPL.git"
, [Parameter(
Mandatory = $false
)]
[switch]$skipInstall
, [Parameter(
Mandatory = $false
)]
[switch]$useCurrent ## use current directory as SPL
)
$splDir = "./build/spl-core"
if ($useCurrent) {
Write-Information -Tags "Info:" -MessageData "Using current directory as SPL."
$splDir = $PSScriptRoot
}
else {
Write-Information -Tags "Info:" -MessageData "Cloning SPL version: $version from $repo_url"
if (-Not (Get-Command git -ErrorAction SilentlyContinue)) {
throw "'git' executable not found, please install it."
}
# This check works for tags as versions, only.
# Use with care when you give a branch as version (no git pull here)
if (Test-Path "$splDir/$version") {
Write-Information -Tags "Info:" -MessageData "SPL-core version already set to $version, no update."
}
else {
if (Test-Path "$splDir") {
Remove-Item "$splDir" -Recurse -Force
}
git clone $repo_url --config advice.detachedHead=false --branch $version --depth 1 "$splDir"
Out-File -FilePath "$splDir/$version"
}
}
Push-Location "$splDir"
if ($skipInstall) {
Write-Information -Tags "Info:" -MessageData "Skipping installation of dependencies."
}
else {
. .\powershell\spl-variables.ps1
. .\powershell\spl-functions.ps1
if ($SPL_PROXY_HOST -and $SPL_PROXY_BYPASS_LIST) {
Initialize-Proxy -ProxyHost $SPL_PROXY_HOST -NoProxy $SPL_PROXY_BYPASS_LIST
}
Install-Basic-Toolset
Install-Toolset -FilePath "scoopfile.json"
}
Pop-Location #$splDir