Skip to content

Commit eec434b

Browse files
committed
Update ssh-studio formula to use a launcher script for resource loading
1 parent f12327c commit eec434b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Formula/ssh-studio.rb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,23 @@ def install
5252

5353
(libexec/"bin").mkpath
5454
mv bin/"ssh-studio", libexec/"bin/ssh-studio" if (bin/"ssh-studio").exist?
55+
resource_file = share/"io.github.BuddySirJava.SSH-Studio/ssh-studio-resources.gresource"
56+
57+
launcher = libexec/"ssh-studio-launch.py"
58+
launcher.write <<~PY
59+
#!/usr/bin/env python3
60+
import sys
61+
from gi.repository import Gio
62+
Gio.resources_register(Gio.Resource.load("#{resource_file}"))
63+
from ssh_studio import main as _main
64+
sys.exit(_main.main())
65+
PY
66+
chmod 0755, launcher
67+
5568
(bin/"ssh-studio").write <<~SH
5669
#!/bin/bash
5770
export PYTHONPATH="#{python_site_packages}"
58-
exec "#{Formula["[email protected]"].opt_bin}/python3" -m ssh_studio.main "$@"
71+
exec "#{Formula["[email protected]"].opt_bin}/python3" "#{launcher}" "$@"
5972
SH
6073
chmod 0755, bin/"ssh-studio"
6174

@@ -83,7 +96,7 @@ def install
8396
(app_root/"MacOS/ssh-studio").write <<~SH
8497
#!/bin/bash
8598
export PYTHONPATH="#{python_site_packages}"
86-
exec "#{Formula["[email protected]"].opt_bin}/python3" -m ssh_studio.main "$@"
99+
exec "#{Formula["[email protected]"].opt_bin}/python3" "#{launcher}" "$@"
87100
SH
88101
chmod 0755, (app_root/"MacOS/ssh-studio")
89102
end

0 commit comments

Comments
 (0)