fix: installer auto-adds mosaic bin to PATH with clear status output
- install.sh: detects shell profile (zsh/bash/profile), adds PATH entry if missing - install.ps1: adds to User PATH via SetEnvironmentVariable if missing - Both are idempotent — show "already in PATH ✓" on re-run - mosaic/mosaic.ps1: accept "help" and "version" as bare subcommands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
15
install.ps1
15
install.ps1
@@ -66,8 +66,21 @@ catch {
|
||||
Write-Host "[mosaic-install] WARNING: doctor reported issues (run mosaic-doctor.ps1 -FailOnWarn)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Ensure mosaic bin is in User PATH persistently
|
||||
$mosaicBin = Join-Path $TargetDir "bin"
|
||||
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
||||
if ($userPath -and $userPath.Split(";") -contains $mosaicBin) {
|
||||
Write-Host "[mosaic-install] PATH: $mosaicBin already in User PATH ✓"
|
||||
}
|
||||
else {
|
||||
$newPath = if ($userPath) { "$mosaicBin;$userPath" } else { $mosaicBin }
|
||||
[Environment]::SetEnvironmentVariable("Path", $newPath, "User")
|
||||
$env:Path = "$mosaicBin;$env:Path"
|
||||
Write-Host "[mosaic-install] PATH: Added $mosaicBin to User PATH ✓"
|
||||
Write-Host "[mosaic-install] Open a new terminal for PATH changes to take effect."
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Done."
|
||||
Write-Host "[mosaic-install] Add to PATH: `$env:USERPROFILE\.config\mosaic\bin"
|
||||
|
||||
$soulPath = Join-Path $TargetDir "SOUL.md"
|
||||
if (-not (Test-Path $soulPath)) {
|
||||
|
||||
Reference in New Issue
Block a user