This commit is contained in:
2026-01-01 00:54:03 -08:00
parent ff3bcb6611
commit f3c79609d8
8 changed files with 32 additions and 316 deletions

View File

@@ -226,8 +226,8 @@ if (-not $NoInstall) {
# Verify top-level 'CLI' import and (if missing) attempt to make it available
Write-Log "Verifying installed CLI import..."
try {
& $venvPython -c "import importlib; importlib.import_module('medeia_macina.cli_entry')" 2>$null
if ($LASTEXITCODE -eq 0) { Write-Log "OK: 'medeia_macina.cli_entry' is importable in the venv." }
& $venvPython -c "import importlib; importlib.import_module('scripts.cli_entry')" 2>$null
if ($LASTEXITCODE -eq 0) { Write-Log "OK: 'scripts.cli_entry' is importable in the venv." }
} catch {}
try {
@@ -493,7 +493,7 @@ if ($IsWindowsPlatform) {
$target = $mmExe
} else {
$target = $venvPython
$args = "-m medeia_macina.cli_entry"
$args = "-m scripts.cli_entry"
}
if ($CreateDesktopShortcut) {
$desk = [Environment]::GetFolderPath('Desktop')
@@ -545,10 +545,10 @@ if ($env:MM_DEBUG) {
if (Test-Path $py) { & $py -c "import sys,importlib,importlib.util,traceback; print('sys.executable:', sys.executable); print('sys.path (first 8):', sys.path[:8]);" }
else { python -c "import sys,importlib,importlib.util,traceback; print('sys.executable:', sys.executable); print('sys.path (first 8):', sys.path[:8]);" }
}
if (Test-Path $py) { & $py -m medeia_macina.cli_entry @args; exit $LASTEXITCODE }
if (Test-Path $py) { & $py -m scripts.cli_entry @args; exit $LASTEXITCODE }
if (Test-Path (Join-Path $repo 'CLI.py')) { & python (Join-Path $repo 'CLI.py') @args; exit $LASTEXITCODE }
# fallback
python -m medeia_macina.cli_entry @args
python -m scripts.cli_entry @args
'@
# Thin wrapper: prefer the canonical Python bootstrap installer
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
@@ -587,7 +587,7 @@ Write-Host 'Error: no suitable Python 3 interpreter found. Please install Python
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 'medeia_macina.cli_entry')
# (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
@@ -626,7 +626,7 @@ 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 medeia_macina.cli_entry"
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" }