-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.ps1
More file actions
executable file
·31 lines (27 loc) · 1.01 KB
/
install.ps1
File metadata and controls
executable file
·31 lines (27 loc) · 1.01 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
#!/usr/bin/pwsh -c
$ErrorActionPreference = "Stop"
Write-Host "Building μHigh compiler..."
$OS_version = [System.Environment]::OSVersion.Version.ToString()
dotnet build --configuration Release uhigh.csproj
dotnet pack uhigh.csproj
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Check if the tool is already installed
$toolInstalled = dotnet tool list --global | Select-String -Pattern "uhigh"
if ($toolInstalled) {
Write-Host "Uninstalling previous version of uhigh..."
dotnet tool uninstall --global uhigh
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
} else {
Write-Host "uhigh is not currently installed."
}
Write-Host "Installing μHigh as global tool..."
dotnet tool install --global --add-source ./bin/Release uhigh
if ($LASTEXITCODE -eq 0) {
Write-Host "μHigh installed successfully!"
Write-Host "You can now use 'uhigh' command from anywhere."
Write-Host ""
Write-Host "Try: uhigh --help"
} else {
Write-Host "Installation failed with exit code $LASTEXITCODE"
}
exit $LASTEXITCODE