ff
This commit is contained in:
@@ -584,49 +584,4 @@ if (Get-Command -Name python -ErrorAction SilentlyContinue) {
|
||||
}
|
||||
|
||||
Write-Host 'Error: no suitable Python 3 interpreter found. Please install Python 3 or use the venv.' -ForegroundColor Red
|
||||
exit 127 # Inject the actual repo path safely (escape embedded double-quotes if any)
|
||||
$ps1Text = $ps1Text.Replace('__REPO__', $repo.Replace('"', '""'))
|
||||
# Ensure the PowerShell shim falls back to the correct module when the venv isn't present
|
||||
# (No legacy 'medeia_entry' shim - use the packaged entry 'scripts.cli_entry')
|
||||
if (Test-Path $mmPs1) {
|
||||
$bak = "$mmPs1.bak$(Get-Date -UFormat %s)"
|
||||
Move-Item -Path $mmPs1 -Destination $bak -Force
|
||||
}
|
||||
Set-Content -LiteralPath $mmPs1 -Value $ps1Text -Encoding UTF8
|
||||
|
||||
# Ensure user's bin is on PATH (User env var)
|
||||
try {
|
||||
$cur = [Environment]::GetEnvironmentVariable('PATH', 'User')
|
||||
if ($cur -notlike "*$globalBin*") {
|
||||
if ($cur) { $new = ($globalBin + ';' + $cur) } else { $new = $globalBin }
|
||||
[Environment]::SetEnvironmentVariable('PATH', $new, 'User')
|
||||
# Update current session PATH for immediate use
|
||||
$env:PATH = $globalBin + ';' + $env:PATH
|
||||
Write-Log "Added $globalBin to User PATH. Restart your shell to pick this up." "INFO"
|
||||
} else {
|
||||
Write-Log "$globalBin is already on the User PATH" "INFO"
|
||||
}
|
||||
} catch {
|
||||
Write-Log "Failed to update user PATH: $_" "ERROR"
|
||||
}
|
||||
} catch {
|
||||
Write-Log "Failed to install global launcher: $_" "ERROR"
|
||||
}
|
||||
|
||||
Write-Log "Bootstrap complete." "INFO"
|
||||
Write-Host ""
|
||||
Write-Host "To activate the venv:"
|
||||
if ($IsWindowsPlatform) {
|
||||
Write-Host " PS> .\$VenvPath\Scripts\Activate.ps1"
|
||||
Write-Host " CMD> .\$VenvPath\Scripts\activate.bat"
|
||||
} else {
|
||||
Write-Host " $ source ./$VenvPath/bin/activate"
|
||||
}
|
||||
Write-Host ""
|
||||
Write-Host "To run the app:"
|
||||
Write-Host " $ .\$VenvPath\Scripts\mm.exe (Windows) or"
|
||||
Write-Host " $ ./$VenvPath/bin/mm (Linux) or"
|
||||
Write-Host " $ $venvPython -m scripts.cli_entry"
|
||||
Write-Host ""
|
||||
Write-Host "If the global 'mm' launcher fails, collect runtime diagnostics by setting MM_DEBUG and re-running the command:"
|
||||
if ($IsWindowsPlatform) { Write-Host " PowerShell: $env:MM_DEBUG = '1'; mm" } else { Write-Host " POSIX: MM_DEBUG=1 mm" }
|
||||
exit 127
|
||||
|
||||
Reference in New Issue
Block a user