-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstage_media.ps1
More file actions
43 lines (36 loc) · 1.47 KB
/
Copy pathstage_media.ps1
File metadata and controls
43 lines (36 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<#
.SYNOPSIS
Cross-platform media staging launcher for DaVinci Resolve, DxO PhotoLab, and NLEs on Windows 11.
.DESCRIPTION
Launches stage_media.py with --clean and --open by default,
or forwards custom arguments to the Python script.
#>
[CmdletBinding()]
param(
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$ScriptArgs
)
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$PythonScript = Join-Path $ScriptDir "stage_media.py"
# Locate Python
$PythonExe = Get-Command "python" -ErrorAction SilentlyContinue
if (-not $PythonExe) {
$PythonExe = Get-Command "py" -ErrorAction SilentlyContinue
}
if (-not $PythonExe) {
Write-Error "[ERROR] Python was not found in PATH. Please ensure Python 3 is installed."
exit 1
}
Write-Host "==========================================================" -ForegroundColor Cyan
Write-Host " Flat Media Staging Launcher (Windows 11)" -ForegroundColor Cyan
Write-Host "==========================================================" -ForegroundColor Cyan
if ($ScriptArgs.Count -eq 0) {
Write-Host "[INFO] Running default staging with --clean and --open..." -ForegroundColor Green
& $PythonExe.Source $PythonScript --clean --open
} else {
Write-Host "[INFO] Running staging with custom arguments: $($ScriptArgs -join ' ')" -ForegroundColor Yellow
& $PythonExe.Source $PythonScript @ScriptArgs
}
if ($LASTEXITCODE -ne 0) {
Write-Error "[ERROR] Staging script exited with error code $LASTEXITCODE"
}