Build the CLI from source, expose it through Homebrew, and supervise the long-running daemon through brew services.
- commit
- b23bb77c67c558272f07e2ccd12caca0b17ddcfc
- parent
- 952de5b4cfe1293652fdb0606e83e2fb4bd37c38
- author
- Dami <dami.etoile@gmail.com>
| A | Formula/ | 27 | +++++++++++++++++++++++++++ |
@@ -0,0 +1,27 @@
1+class Devsite < Formula2+ desc "Share public work and reach local TCP services"3+ homepage "https://dev.site"4+ license any_of: ["MIT", "Apache-2.0"]5+ head "https://github.com/FelineStateMachine/devsite.git", branch: "main"6+7+ depends_on "rust" => :build8+9+ def install10+ system "cargo", "install", *std_cargo_args(path: "crates/devsite-cli")11+ end12+13+ service do14+ run [opt_bin/"devsite", "daemon", "run"]15+ keep_alive true16+ log_path var/"log/devsite.log"17+ error_log_path var/"log/devsite.log"18+ end19+20+ test do21+ assert_match(/^devsite \d+\.\d+\.\d+$/, shell_output("#{bin}/devsite --version").strip)22+ assert_match "status", shell_output("#{bin}/devsite daemon --help")23+ output = shell_output("DEVSITE_HOME=#{testpath}/home #{bin}/devsite --json status")24+ assert_match '"command":"status"', output25+ assert_match '"ok":true', output26+ end27+end