From 8f60aeb21b37c690bfbabed26a6bc18f0cf079f3 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 18 Mar 2024 16:01:05 +0000 Subject: [PATCH 1/2] Depend on python@3.11 for now --- Formula/crab.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/crab.rb b/Formula/crab.rb index 344d65e..5b50906 100644 --- a/Formula/crab.rb +++ b/Formula/crab.rb @@ -7,7 +7,7 @@ class Crab < Formula sha256 "fdac36fe63a0a822e44c14dbd08e7b64106317fadeb31239531491772a0b36bc" head "https://github.com/dabapps/crab.git" - depends_on "python@3" + depends_on "python@3.11" def install venv = virtualenv_create(libexec, "python3", without_pip: false) From d5f3fd3e8de31c9114f782b8590db7a76c5bea4a Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 18 Mar 2024 16:07:32 +0000 Subject: [PATCH 2/2] Use service directive and remove plist --- Formula/crab.rb | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/Formula/crab.rb b/Formula/crab.rb index 5b50906..e8cc445 100644 --- a/Formula/crab.rb +++ b/Formula/crab.rb @@ -16,36 +16,12 @@ def install venv.pip_install_and_link buildpath end - def plist - <<~EOS - - - - - KeepAlive - - Label - #{plist_name} - ProgramArguments - - #{bin}/crab - router - - RunAtLoad - - WorkingDirectory - #{HOMEBREW_PREFIX} - StandardOutPath - #{var}/log/crab.log - StandardErrorPath - #{var}/log/crab.log - - - 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