From dcd5a7feb7e0d2d4232a0301ac749512e9b4cca7 Mon Sep 17 00:00:00 2001 From: stan44 Date: Wed, 4 Mar 2026 07:52:17 -0600 Subject: [PATCH] Resolved a build issue in the scripts on linux systems (maybe) --- scripts/publish-output.py | 6 +++++- scripts/sync-output.py | 23 ++++++++++++++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/scripts/publish-output.py b/scripts/publish-output.py index 82c4aaa..92c0afd 100644 --- a/scripts/publish-output.py +++ b/scripts/publish-output.py @@ -108,7 +108,11 @@ def main() -> int: return code target_dir = app_root / "src-tauri" / "target" / ("debug" if args.configuration == "Debug" else "release") - exes = sorted(target_dir.glob("*.exe"), key=lambda p: p.stat().st_mtime, reverse=True) + if args.runtime.startswith("win-") or getattr(sys, "platform", "").startswith("win"): + exes = sorted(target_dir.glob("*.exe"), key=lambda p: p.stat().st_mtime, reverse=True) + else: + exes = sorted((p for p in target_dir.glob("*") if p.is_file() and not p.suffix), key=lambda p: p.stat().st_mtime, reverse=True) + if exes: staged = output_root / exes[0].name if args.dry_run: diff --git a/scripts/sync-output.py b/scripts/sync-output.py index 8a28a2b..442942a 100644 --- a/scripts/sync-output.py +++ b/scripts/sync-output.py @@ -46,8 +46,12 @@ def main() -> int: sidecar_proj = next((p.parent for p in repo_root.rglob("*.csproj") if "sidecar" in str(p).lower()), None) sidecar_bin = sidecar_proj / "bin" if sidecar_proj else None if sidecar_bin is not None: - sidecar_pattern = "*.exe" if os.name == "nt" else "*" - sidecar_exe = newest_file(sidecar_bin, sidecar_pattern) + if os.name == "nt": + sidecar_exe = newest_file(sidecar_bin, "*.exe") + else: + candidates = [p for p in sidecar_bin.rglob("*") if p.is_file() and not p.suffix and os.access(p, os.X_OK)] + sidecar_exe = max(candidates, key=lambda p: p.stat().st_mtime) if candidates else None + if sidecar_exe is not None: copy_tree_contents(sidecar_exe.parent, output_dir) print(f"Synced sidecar -> {output_dir}") @@ -57,8 +61,12 @@ def main() -> int: gateway_proj = next((p.parent for p in repo_root.rglob("*.csproj") if "gateway" in str(p).lower()), None) gateway_bin = gateway_proj / "bin" if gateway_proj else None if gateway_bin is not None: - gateway_pattern = "*.exe" if os.name == "nt" else "*" - gw_exe = newest_file(gateway_bin, gateway_pattern) + if os.name == "nt": + gw_exe = newest_file(gateway_bin, "*.exe") + else: + candidates = [p for p in gateway_bin.rglob("*") if p.is_file() and not p.suffix and os.access(p, os.X_OK)] + gw_exe = max(candidates, key=lambda p: p.stat().st_mtime) if candidates else None + if gw_exe is not None: gw_out = output_dir / "webgateway" copy_tree_contents(gw_exe.parent, gw_out) @@ -69,7 +77,12 @@ def main() -> int: tauri_target = next((p for p in repo_root.rglob("src-tauri") if (p / "target").exists()), None) tauri_target = tauri_target / "target" if tauri_target else None if tauri_target is not None: - app_exe = newest_file(tauri_target, "*.exe") + if os.name == "nt": + app_exe = newest_file(tauri_target, "*.exe") + else: + candidates = [p for p in tauri_target.rglob("*") if p.is_file() and not p.suffix and os.access(p, os.X_OK)] + app_exe = max(candidates, key=lambda p: p.stat().st_mtime) if candidates else None + if app_exe is not None: shutil.copy2(app_exe, output_dir / app_exe.name) print(f"Synced desktop app ({app_exe.name}) -> {output_dir}")