feat: add Windows PowerShell support and remote install one-liners
- remote-install.sh: POSIX one-liner (curl | sh), downloads archive to tmpdir - remote-install.ps1: Windows one-liner (irm | iex), fully native PowerShell - install.ps1: Native Windows installer calling all .ps1 post-install scripts - bin/mosaic-link-runtime-assets.ps1: Syncs runtime config files - bin/mosaic-sync-skills.ps1: Clones skills, links via directory junctions - bin/mosaic-migrate-local-skills.ps1: Migrates local skills to junctions - bin/mosaic-doctor.ps1: Health audit for Windows environments Directory junctions used instead of symlinks (no elevation required). All junction operations fall back to file copy on failure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
70
install.ps1
Normal file
70
install.ps1
Normal file
@@ -0,0 +1,70 @@
|
||||
# Mosaic Bootstrap — Windows Installer
|
||||
# PowerShell equivalent of install.sh
|
||||
#
|
||||
# Usage:
|
||||
# powershell -ExecutionPolicy Bypass -File install.ps1
|
||||
#
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$SourceDir = $PSScriptRoot
|
||||
$TargetDir = if ($env:MOSAIC_HOME) { $env:MOSAIC_HOME } else { Join-Path $env:USERPROFILE ".config\mosaic" }
|
||||
|
||||
if (-not (Test-Path $TargetDir)) { New-Item -ItemType Directory -Path $TargetDir -Force | Out-Null }
|
||||
|
||||
# Sync files: remove old content, copy new
|
||||
Write-Host "[mosaic-install] Copying framework to $TargetDir..."
|
||||
Get-ChildItem $TargetDir -Exclude ".git" | Remove-Item -Recurse -Force
|
||||
Get-ChildItem $SourceDir -Exclude ".git" | ForEach-Object {
|
||||
$dest = Join-Path $TargetDir $_.Name
|
||||
if ($_.PSIsContainer) {
|
||||
Copy-Item $_.FullName $dest -Recurse -Force
|
||||
}
|
||||
else {
|
||||
Copy-Item $_.FullName $dest -Force
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Installed framework to $TargetDir"
|
||||
|
||||
# Run post-install scripts (PowerShell versions)
|
||||
$binDir = Join-Path $TargetDir "bin"
|
||||
|
||||
Write-Host "[mosaic-install] Linking runtime compatibility assets"
|
||||
try {
|
||||
& "$binDir\mosaic-link-runtime-assets.ps1"
|
||||
}
|
||||
catch {
|
||||
Write-Host "[mosaic-install] WARNING: runtime asset linking failed (framework install still complete)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Syncing universal skills"
|
||||
if ($env:MOSAIC_SKIP_SKILLS_SYNC -eq "1") {
|
||||
Write-Host "[mosaic-install] Skipping skills sync (MOSAIC_SKIP_SKILLS_SYNC=1)"
|
||||
}
|
||||
else {
|
||||
try {
|
||||
& "$binDir\mosaic-sync-skills.ps1"
|
||||
}
|
||||
catch {
|
||||
Write-Host "[mosaic-install] WARNING: skills sync failed (framework install still complete)" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Migrating runtime-local skills to Mosaic junctions"
|
||||
try {
|
||||
& "$binDir\mosaic-migrate-local-skills.ps1" -Apply
|
||||
}
|
||||
catch {
|
||||
Write-Host "[mosaic-install] WARNING: local skill migration failed (framework install still complete)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Running health audit"
|
||||
try {
|
||||
& "$binDir\mosaic-doctor.ps1"
|
||||
}
|
||||
catch {
|
||||
Write-Host "[mosaic-install] WARNING: doctor reported issues (run mosaic-doctor.ps1 -FailOnWarn)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "[mosaic-install] Done."
|
||||
Write-Host "[mosaic-install] Add to PATH: `$env:USERPROFILE\.config\mosaic\bin"
|
||||
Reference in New Issue
Block a user