Skip to content

Commit 81c8df3

Browse files
committed
Update macOS DMG workflow to fix resource path handling
1 parent 3774433 commit 81c8df3

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

.github/workflows/macos-dmg.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ jobs:
222222
RES="$SCRIPT_DIR/../Resources"
223223
FW="$SCRIPT_DIR/../Frameworks"
224224
225+
export RES
225226
if [ -d "$FW/Python.framework/Versions/3.13" ]; then
226227
export PYTHONHOME="$FW/Python.framework/Versions/3.13"
227228
else
@@ -245,20 +246,17 @@ jobs:
245246
"$PYBIN" - <<'PY'
246247
import os, sys
247248
from gi.repository import Gio
248-
base = os.path.dirname(__file__)
249-
candidates = [
250-
os.path.join(base, '..', 'Resources', 'ssh-studio-resources.gresource'),
251-
os.path.join(base, '..', 'Resources', 'share', 'io.github.BuddySirJava.SSH-Studio', 'ssh-studio-resources.gresource'),
252-
]
253-
res_path = None
254-
for c in candidates:
255-
if os.path.exists(c):
256-
res_path = c
257-
break
249+
res_dir = os.environ.get('RES')
250+
candidates = []
251+
if res_dir:
252+
candidates.append(os.path.join(res_dir, 'ssh-studio-resources.gresource'))
253+
candidates.append(os.path.join(res_dir, 'share', 'io.github.BuddySirJava.SSH-Studio', 'ssh-studio-resources.gresource'))
254+
res_path = next((c for c in candidates if os.path.exists(c)), None)
258255
if not res_path:
259256
raise SystemExit('ssh-studio-resources.gresource not found in expected locations')
260257
Gio.resources_register(Gio.Resource.load(res_path))
261-
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'Resources', 'python'))
258+
if res_dir:
259+
sys.path.insert(0, os.path.join(res_dir, 'python'))
262260
from ssh_studio import main as _main
263261
sys.exit(_main.main())
264262
PY

0 commit comments

Comments
 (0)