Untestet install.ps1 cleanup.

This commit is contained in:
Sebastian Jeltsch
2025-12-17 22:35:53 +01:00
parent c536aaf341
commit aff88f05e2
+6 -165
View File
@@ -1,5 +1,5 @@
# Install script for: https://github.com/trailbaseio/trailbase generated by
# https://instl.sh
# Install script for: https://github.com/trailbaseio/trailbase originally
# generated using https://instl.sh. License note at the end.
#
# To use this install script, run the following command:
#
@@ -145,136 +145,6 @@ function fGrayLight
Write-Host $Msg -NoNewline -ForegroundColor Gray
}
# Background Colors
function bRed
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkRed
}
function bRedLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Red
}
function bGreen
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkGreen
}
function bGreenLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Green
}
function bYellow
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkYellow
}
function bYellowLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Yellow
}
function bBlue
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkBlue
}
function bBlueLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Blue
}
function bMagenta
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkMagenta
}
function bMagentaLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Magenta
}
function bCyan
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkCyan
}
function bCyanLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Cyan
}
function bWhite
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor White
}
function bBlack
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Black
}
function bGray
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor DarkGray
}
function bGrayLight
{
param (
$Msg
)
Write-Host $Msg -NoNewline -BackgroundColor Gray
}
# Special Colors
function resetColor
@@ -284,22 +154,6 @@ function resetColor
# Theme
function primaryColor
{
param (
$Msg
)
fCyan $Msg
}
function secondaryColor
{
param (
$Msg
)
fMagentaLight $Msg
}
function info
{
param (
@@ -371,7 +225,7 @@ verbose "Setting up variables"
$owner = "trailbaseio"
$repo = "trailbase"
$tmpDir = "$env:TEMP\instl-cache"
$tmpDir = "$env:TEMP\trailbase-cache"
verbose "Temporary directory: $tmpDir"
# Remove previous cache, if it exists
if (test-path $tmpDir)
@@ -380,7 +234,7 @@ if (test-path $tmpDir)
}
New-Item -Path $tmpDir -ItemType Directory > $null
$installLocation = "$HOME\instl\$repo"
$installLocation = "$HOME\$repo"
verbose "Install location: $installLocation"
# Remove previous installation, if it exists
if (test-path $installLocation)
@@ -389,22 +243,12 @@ if (test-path $installLocation)
}
New-Item -Path $installLocation -ItemType Directory > $null
# Print "INSTL" header
# --- Sourced from file: ../shared/intro.ps1 ---
fBlueLight 'Instl is an installer for GitHub Projects'
echo ""
fBlue ' > https://instl.sh'
echo ""
# --- End of ../shared/intro.ps1 ---
# Installation
$headers = @{
'user-agent' = 'instl'
}
$headers = @{}
# Check for GH_TOKEN in environment variables
if ($env:GH_TOKEN) {
@@ -533,19 +377,16 @@ info "Installing $repo"
# Extract asset if it is a zip file
if ( $assetName.EndsWith(".zip"))
{
verbose "Extracting asset..."
Expand-Archive -Path $assetPath -Destination $installLocation\
Expand-Archive -Path $assetPath -Destination $installLocation
verbose "Asset extracted to $installLocation"
}
elseif ( $assetName.EndsWith(".tar.gz"))
{
verbose "Extracting asset..."
tar -xzf $assetPath -C $installLocation
verbose "Asset extracted to $installLocation"
}
elseif ( $assetName.EndsWith(".tar"))
{
verbose "Extracting asset..."
tar -xf $assetPath -C $installLocation
verbose "Asset extracted to $installLocation"
}