Skip to content

Commit

Permalink
morpheus-release: Write standard exec script for morpheus-gui, adap…
Browse files Browse the repository at this point in the history
…t `post_install` to changed Info.plist
  • Loading branch information
jdieg0 committed Mar 27, 2024
1 parent e0558b3 commit c2d66c1
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions Formula/morpheus-release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,13 @@ def install

if OS.mac?
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus"

(bin/"morpheus-gui").write <<~EOS
#!/bin/bash
open #{prefix}/Morpheus.app
EOS
(bin/"morpheus-gui").chmod 0555
bin.write_exec_script "#{prefix}/Morpheus.app/Contents/MacOS/morpheus-gui"
end
end

def post_install
if OS.mac?
# Set PATH environment variable including Homebrew prefix in macOS app bundle
inreplace "#{prefix}/Morpheus.app/Contents/Info.plist", "<key>CFBundleExecutable</key>",
<<~EOS.chomp
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>#{ENV["PATH"]}</string>
</dict>
<key>CFBundleExecutable</key>
EOS
end
# Set PATH environment variable including Homebrew prefix in macOS app bundle
inreplace "#{prefix}/Morpheus.app/Contents/Info.plist", "HOMEBREW_BIN_PATH", ENV["PATH"] if OS.mac?
end

def caveats
Expand Down

0 comments on commit c2d66c1

Please sign in to comment.