forked from ShellLite/ShellLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
21 lines (21 loc) · 927 Bytes
/
install.ps1
File metadata and controls
21 lines (21 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$InstallDir = "$env:LOCALAPPDATA\ShellLite"
$ExePath = Join-Path $PSScriptRoot "shl.exe"
if (-not (Test-Path $ExePath)) {
Write-Error "shl.exe not found in current directory. Please run this after building."
exit
}
Write-Host "Installing ShellLite to $InstallDir..."
if (-not (Test-Path $InstallDir)) {
New-Item -ItemType Directory -Path $InstallDir
}
Copy-Item $ExePath -Destination $InstallDir -Force
Write-Host "ShellLite binary copied."
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($UserPath -notlike "*$InstallDir*") {
Write-Host "Adding $InstallDir to User PATH..."
[Environment]::SetEnvironmentVariable("Path", $UserPath + ";" + $InstallDir, "User")
Write-Host "PATH updated. Please restart your terminal."
} else {
Write-Host "ShellLite is already in your PATH."
}
Write-Host "`nInstallation complete! You can now run 'shl' from any terminal." -ForegroundColor Green