33 lines
1.4 KiB
Ruby
33 lines
1.4 KiB
Ruby
class Sd < Formula
|
|
desc "Intuitive find & replace CLI"
|
|
homepage "https://github.com/chmln/sd"
|
|
url "https://github.com/chmln/sd/archive/v0.7.6.tar.gz"
|
|
sha256 "faf33a97797b95097c08ebb7c2451ac9835907254d89863b10ab5e0813b5fe5f"
|
|
license "MIT"
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "57aa8ffe25e54e25d3657c662faacd04a80e3dc38755d3dbf83f125c58780145"
|
|
sha256 cellar: :any_skip_relocation, big_sur: "54cba0185e51722d724fd3997f44c602ddb23011ae5d8423a97557761c9ab7a2"
|
|
sha256 cellar: :any_skip_relocation, catalina: "649c660b6e8a4a77e5fc9dd12b1aa28a59212f676d2394f7e3ea682a9d3cc533"
|
|
sha256 cellar: :any_skip_relocation, mojave: "1b451f55b69988e53a7699005f5aac1e50ed30e466ea0bbf1b30d382887360b1"
|
|
sha256 cellar: :any_skip_relocation, high_sierra: "971451d1dd8fb3340c9c5a74ea20769e114362e84b0f9bb9a0ead52881c71196"
|
|
end
|
|
|
|
depends_on "rust" => :build
|
|
|
|
def install
|
|
system "cargo", "install", *std_cargo_args
|
|
|
|
# Completion scripts and manpage are generated in the crate's build
|
|
# directory, which includes a fingerprint hash. Try to locate it first
|
|
out_dir = Dir["target/release/build/sd-*/out"].first
|
|
man1.install "#{out_dir}/sd.1"
|
|
bash_completion.install "#{out_dir}/sd.bash"
|
|
zsh_completion.install "#{out_dir}/_sd"
|
|
end
|
|
|
|
test do
|
|
assert_equal "after", pipe_output("#{bin}/sd before after", "before")
|
|
end
|
|
end
|