-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathSetup-Host.ps1
More file actions
38 lines (29 loc) · 1.09 KB
/
Setup-Host.ps1
File metadata and controls
38 lines (29 loc) · 1.09 KB
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
function Setup-Host {
if ( ! ( Test-Path function:Log-Output ) ) {
. $PSScriptRoot/Logger.ps1
}
if ( ! ( Test-Path function:Check-Git ) ) {
. $PSScriptRoot/Check-Git.ps1
}
Check-Git
if ( ! ( Test-Path function:Invoke-External ) ) {
. $PSScriptRoot/Invoke-External.ps1
}
try {
$script:ProjectRoot = Invoke-External git rev-parse --show-toplevel 2>$null
} catch {
Log-Warning "Not running in a git repository, interpreting project root instead"
$script:ProjectRoot = $($script:PSScriptRoot)
}
$script:WorkRoot = "${ProjectRoot}/windows_build_temp"
if ( ! ( $script:SkipAll ) && ( $script:SkipDeps ) ) {
if ( ! ( Test-Path function:Install-BuildDependencies ) ) {
. $PSScriptRoot/Install-BuildDependencies.ps1
}
Install-BuildDependencies -WingetFile ${script:PSScriptRoot}/.Wingetfile
}
}
function Cleanup {
Log-Debug "Running Cleanup actions"
}
$script:HostArchitecture = ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture).ToString().ToLower()