matiaskorhonen / paper-age

Easy and secure paper backups of secrets
MIT License
422 stars 8 forks source link

Homebrew formula #8

Closed matiaskorhonen closed 1 year ago

matiaskorhonen commented 1 year ago

Create a Homebrew formula for macOS


class PaperAge < Formula
  desc "Easy and secure paper backups of secrets"
  homepage "https://github.com/matiaskorhonen/paper-age"
  url "https://github.com/matiaskorhonen/paper-age/archive/refs/tags/v1.0.0.tar.gz"
  sha256 "9744ef316edd42814adbb9f5377c09a590c08bee4a11b53060fd1e540bcaa8f8"
  license "MIT"
  head "https://github.com/matiaskorhonen/paper-age.git", branch: "main"

  depends_on "rust" => :build

  def install
    system "cargo", "install", "--root", prefix, "--path", "."
  end

  test do
    (testpath/"sample.txt").write("Hello World")
    with_env(PAPERAGE_PASSPHRASE: "snakeoil") do
      system bin/"paper-age", "--output", testpath/"output.pdf", testpath/"sample.txt"
    end
    assert_path_exists testpath/"output.pdf"
  end
end