Skip to content

Commit

Permalink
Use service directive and remove plist
Browse files Browse the repository at this point in the history
  • Loading branch information
jordaneb authored Mar 18, 2024
1 parent 8f60aeb commit d5f3fd3
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions Formula/crab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,12 @@ def install
venv.pip_install_and_link buildpath
end

def plist
<<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{bin}/crab</string>
<string>router</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
<key>StandardOutPath</key>
<string>#{var}/log/crab.log</string>
<key>StandardErrorPath</key>
<string>#{var}/log/crab.log</string>
</dict>
</plist>
EOS
end

service do
name macos: "#{plist_name}"
run [bin/"crab", "router"]
keep_alive true
working_dir HOMEBREW_PREFIX
log_path var/"log/crab.log"
error_log_path var/"log/crab.log"
end

test do
Expand Down

0 comments on commit d5f3fd3

Please sign in to comment.