-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrun.ps1
More file actions
29 lines (26 loc) · 894 Bytes
/
Copy pathrun.ps1
File metadata and controls
29 lines (26 loc) · 894 Bytes
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
#!/usr/bin/env pwsh
param(
[string]$Python = "python",
[int]$Major = 2,
[int]$Minor = 3
)
$ErrorActionPreference = "Stop"
if (-not (Test-Path -LiteralPath (Join-Path $PSScriptRoot "generated\__init__.py"))) {
throw "Generated bindings were not found. Run generate.ps1 first."
}
if (-not (Test-Path -LiteralPath (Join-Path $PSScriptRoot ".runtime\Microsoft.WindowsAppRuntime.Bootstrap.dll"))) {
throw "The WinAppSDK bootstrap DLL was not found. Run generate.ps1 first."
}
if (-not [System.IO.Path]::IsPathRooted($Python)) {
$callerPython = Join-Path (Get-Location).Path $Python
if (Test-Path -LiteralPath $callerPython -PathType Leaf) {
$Python = [System.IO.Path]::GetFullPath($callerPython)
}
}
& $Python (Join-Path $PSScriptRoot "app.py") `
--loopback `
--major $Major `
--minor $Minor
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}