jhj
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
This commit is contained in:
@@ -1,6 +1,58 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Bootstrap a Python virtualenv and install the project on Windows (PowerShell).
|
||||
function Ensure-Mpv {
|
||||
# mpv is used by some pipelines; try to ensure it's available on PATH.
|
||||
try {
|
||||
$mpvCmd = Get-Command mpv -ErrorAction SilentlyContinue
|
||||
if ($mpvCmd) {
|
||||
try {
|
||||
$v = & mpv --version 2>$null | Select-Object -First 1
|
||||
if ($v) { Write-Log "mpv found: $v" "INFO" } else { Write-Log "mpv found: $($mpvCmd.Path)" "INFO" }
|
||||
} catch {
|
||||
Write-Log "mpv found: $($mpvCmd.Path)" "INFO"
|
||||
}
|
||||
return
|
||||
}
|
||||
} catch {}
|
||||
|
||||
Write-Log "mpv not found on PATH; attempting to install..." "INFO"
|
||||
|
||||
try {
|
||||
if (Get-Command choco -ErrorAction SilentlyContinue) {
|
||||
& choco install mpv -y --no-progress | Out-Null
|
||||
} elseif (Get-Command scoop -ErrorAction SilentlyContinue) {
|
||||
& scoop install mpv | Out-Null
|
||||
} elseif (Get-Command winget -ErrorAction SilentlyContinue) {
|
||||
# Best-effort: winget may require a specific id depending on environment.
|
||||
& winget install --silent --accept-package-agreements --accept-source-agreements mpv | Out-Null
|
||||
} else {
|
||||
Write-Log "mpv not found and no supported package manager found (choco/scoop/winget). Install mpv and ensure it's on PATH." "ERROR"
|
||||
return
|
||||
}
|
||||
} catch {
|
||||
Write-Log "mpv install attempt failed: $_" "ERROR"
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
$mpvCmd2 = Get-Command mpv -ErrorAction SilentlyContinue
|
||||
if ($mpvCmd2) {
|
||||
try {
|
||||
$v2 = & mpv --version 2>$null | Select-Object -First 1
|
||||
if ($v2) { Write-Log "mpv installed: $v2" "INFO" } else { Write-Log "mpv installed: $($mpvCmd2.Path)" "INFO" }
|
||||
} catch {
|
||||
Write-Log "mpv installed: $($mpvCmd2.Path)" "INFO"
|
||||
}
|
||||
} else {
|
||||
Write-Log "mpv install attempted but mpv is still not on PATH. Install mpv manually." "ERROR"
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
if ($IsWindowsPlatform) {
|
||||
Ensure-Mpv
|
||||
}
|
||||
|
||||
.DESCRIPTION
|
||||
Creates a Python virtual environment (default: .venv), upgrades pip, installs the project
|
||||
|
||||
Reference in New Issue
Block a user