diff --git a/Formula/darkmatter.rb b/Formula/darkmatter.rb deleted file mode 100644 index 6962899..0000000 --- a/Formula/darkmatter.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class Darkmatter < Formula - desc "Command-line app for the Darkmatter/Marmot stack" - homepage "https://github.com/marmot-protocol/darkmatter" - url "ssh://git@github.com/marmot-protocol/darkmatter.git", - tag: "v0.1.0", - revision: "f097e50cf1e7b4c0828423c270ea4280be06bc33" - license "MIT" - - head "ssh://git@github.com/marmot-protocol/darkmatter.git", branch: "master" - - depends_on "rust" => :build - - def install - cli_path = File.directory?("crates/cli") ? "crates/cli" : "crates/dm" - system "cargo", "install", *std_cargo_args(path: cli_path), "--bins" - end - - test do - assert_match "Darkmatter CLI", shell_output("#{bin}/dm --help 2>&1") - assert_match "Darkmatter daemon", shell_output("#{bin}/dmd --help 2>&1") - - home = testpath/"home" - output = shell_output("#{bin}/dm --home #{home} --secret-store file account create") - assert_match "created account", output - end -end diff --git a/Formula/wn.rb b/Formula/wn.rb new file mode 100644 index 0000000..c50fdaa --- /dev/null +++ b/Formula/wn.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# White Noise CLI (`wn` and `wnd`) built from the marmot-protocol/mdk workspace. +class Wn < Formula + desc "Command-line app for the White Noise/Marmot stack" + homepage "https://github.com/marmot-protocol/mdk" + url "https://github.com/marmot-protocol/mdk/archive/refs/tags/v0.9.1.tar.gz" + sha256 "ac7fdf1ba4fbbe9125ca3191a414f51bec12d715d463305efe3419b6e13f3616" + license "MIT" + + head "https://github.com/marmot-protocol/mdk.git", branch: "master" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args(path: "crates/cli"), "--bins" + end + + test do + assert_match "White Noise account, group, message, stream, and daemon CLI", + shell_output("#{bin}/wn --help 2>&1") + assert_match "White Noise background runtime daemon", + shell_output("#{bin}/wnd --help 2>&1") + + # `account create` publishes to a relay, so it cannot run in a sandboxed + # test; `settings show` exercises the data dir and config paths offline. + home = testpath/"home" + output = shell_output("#{bin}/wn --home #{home} --secret-store file settings show") + assert_match "theme=system", output + end +end diff --git a/README.md b/README.md index 9d10191..fcb488d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ `brew install marmot-protocol/tap/` +For example, the White Noise CLI (`wn` and `wnd`): + +`brew install marmot-protocol/tap/wn` + Or `brew tap marmot-protocol/tap` and then `brew install `. Or, in a `brew bundle` `Brewfile`: diff --git a/formula_renames.json b/formula_renames.json new file mode 100644 index 0000000..bf1fb03 --- /dev/null +++ b/formula_renames.json @@ -0,0 +1,3 @@ +{ + "darkmatter": "wn" +}