mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-23 14:00:21 +00:00
Refactor Python script execution in Windows build
This commit is contained in:
committed by
GitHub
parent
87b9e52719
commit
2723d49b3a
28
.github/workflows/windows-build.yml
vendored
28
.github/workflows/windows-build.yml
vendored
@@ -154,14 +154,14 @@ jobs:
|
|||||||
# Create wrapper that runs either the .exe or .py we found.
|
# Create wrapper that runs either the .exe or .py we found.
|
||||||
$genPath = $genAny.FullName.Replace('\','\\')
|
$genPath = $genAny.FullName.Replace('\','\\')
|
||||||
@"
|
@"
|
||||||
import os, subprocess, sys
|
import os, subprocess, sys
|
||||||
tool = r"$genPath"
|
tool = r"$genPath"
|
||||||
if tool.lower().endswith(".py"):
|
if tool.lower().endswith(".py"):
|
||||||
sys.exit(subprocess.call([sys.executable, tool] + sys.argv[1:]))
|
sys.exit(subprocess.call([sys.executable, tool] + sys.argv[1:]))
|
||||||
else:
|
else:
|
||||||
sys.exit(subprocess.call([tool] + sys.argv[1:]))
|
sys.exit(subprocess.call([tool] + sys.argv[1:]))
|
||||||
"@ | Set-Content -Path $genTarget -Encoding ASCII
|
"@ | Set-Content -Path $genTarget -Encoding ASCII
|
||||||
} else {
|
} else {
|
||||||
# Fallback: install MSYS2 glib2 tools and run their glib-genmarshal with PATH set.
|
# Fallback: install MSYS2 glib2 tools and run their glib-genmarshal with PATH set.
|
||||||
Write-Host "glib-genmarshal not found in GTK3 bundle. Installing MSYS2 glib2 tools as a fallback."
|
Write-Host "glib-genmarshal not found in GTK3 bundle. Installing MSYS2 glib2 tools as a fallback."
|
||||||
|
|
||||||
@@ -183,12 +183,12 @@ else:
|
|||||||
$msysBinEsc = $msysBin.Replace('\','\\')
|
$msysBinEsc = $msysBin.Replace('\','\\')
|
||||||
|
|
||||||
@"
|
@"
|
||||||
import os, subprocess, sys
|
import os, subprocess, sys
|
||||||
exe = r"$msysGenEsc"
|
exe = r"$msysGenEsc"
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["PATH"] = r"$msysBinEsc" + ";" + env.get("PATH","")
|
env["PATH"] = r"$msysBinEsc" + ";" + env.get("PATH","")
|
||||||
sys.exit(subprocess.call([exe] + sys.argv[1:], env=env))
|
sys.exit(subprocess.call([exe] + sys.argv[1:], env=env))
|
||||||
"@ | Set-Content -Path $genTarget -Encoding ASCII
|
"@ | Set-Content -Path $genTarget -Encoding ASCII
|
||||||
}
|
}
|
||||||
|
|
||||||
# Compatibility aliases while vcxproj still names GTK2 libs.
|
# Compatibility aliases while vcxproj still names GTK2 libs.
|
||||||
|
|||||||
Reference in New Issue
Block a user