Skip to content

Commit a78dbca

Browse files
committed
Vibe coded rb
1 parent 6913fbf commit a78dbca

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Formula/ssh-studio.rb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,19 @@ def install
3030
end
3131
ENV.prepend_path "PATH", libexec/"bin"
3232

33-
ENV["PYTHON"] = Formula["python@3.13"].opt_bin/"python3"
34-
35-
inreplace "data/ssh-studio.in", "python3", "#{Formula["python@3.13"].opt_bin}/python3"
33+
python3 = Formula["python@3.13"]
34+
python_bin = python3.opt_bin/"python3"
35+
36+
unless python_bin.exist?
37+
odie "Python 3.13 not found at #{python_bin}"
38+
end
3639

40+
ENV["PYTHON"] = python_bin.to_s
3741
system "meson", "setup", "build", *std_meson_args
3842
system "meson", "compile", "-C", "build"
3943
system "meson", "install", "-C", "build"
4044

41-
python_version = Formula["python@3.13"].version.major_minor
45+
python_version = python3.version.major_minor
4246
python_site_packages = lib/"python#{python_version}/site-packages"
4347
python_site_packages.mkpath
4448

@@ -69,7 +73,7 @@ def install
6973
(bin/"ssh-studio").write <<~SH
7074
#!/bin/bash
7175
export PYTHONPATH="#{python_site_packages}"
72-
exec "#{Formula["python@3.13"].opt_bin}/python3" "#{launcher}" "$@"
76+
exec "#{python_bin}" "#{launcher}" "$@"
7377
SH
7478
chmod 0755, bin/"ssh-studio"
7579

@@ -97,7 +101,7 @@ def install
97101
(app_root/"MacOS/ssh-studio").write <<~SH
98102
#!/bin/bash
99103
export PYTHONPATH="#{python_site_packages}"
100-
exec "#{Formula["python@3.13"].opt_bin}/python3" "#{launcher}" "$@"
104+
exec "#{python_bin}" "#{launcher}" "$@"
101105
SH
102106
chmod 0755, (app_root/"MacOS/ssh-studio")
103107
end

0 commit comments

Comments
 (0)