Skip to content

Commit

Permalink
Add homebrew package configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Jan 18, 2023
1 parent def9085 commit 779f1f7
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pkg/brew/prs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Base homebrew package configuration for prs.
#
# You can find the current merged package configuration here:
# - https://github.com/Homebrew/homebrew-core/blob/master/Formula/prs.rb

class Prs < Formula
desc "Secure, fast & convenient password manager CLI with GPG & git sync"
homepage "https://timvisee.com/projects/prs"
url "https://github.com/timvisee/prs/archive/v0.4.1.tar.gz"
sha256 "f7f8f5d815cf1c4034f1c2aa36ed29b7e3ab2a884791b4b69ffc845d5d111524"
license "GPL-3.0-only"

depends_on "rust" => :build
depends_on "gpgme"

on_linux do
depends_on "pkg-config" => :build
depends_on "libxcb"
depends_on "openssl@3"
end

def install
system "cargo", "install", *std_cargo_args(path: "cli")

generate_completions_from_executable(bin/"prs", "internal", "completions")
end

test do
ENV["PASSWORD_STORE_DIR"] = testpath/".store"
expected = <<~EOS
Now generate and add a new recipient key for yourself:
prs recipients generate
EOS

assert_equal expected, shell_output("#{bin}/prs init --no-interactive 2>&1")
assert_equal "prs-cli #{version}\n", shell_output("#{bin}/prs --version")
assert_equal "", shell_output("#{bin}/prs list --no-interactive --quiet")
end
end

0 comments on commit 779f1f7

Please sign in to comment.