pipe-rename 1.4.2 (new formula)

Closes #105108.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
PythonCoderAS 2022-07-04 21:39:36 -04:00 committed by BrewTestBot
parent db82947f7d
commit 832ca8826a
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 23 additions and 0 deletions

23
Formula/pipe-rename.rb Normal file
View File

@ -0,0 +1,23 @@
class PipeRename < Formula
desc "Rename your files using your favorite text editor"
homepage "https://github.com/marcusbuffett/pipe-rename"
url "https://crates.io/api/v1/crates/pipe-rename/1.4.2/download"
sha256 "9ab27232bc216e23c567ecdcd6f8a590f76a24aa5d9a563e73a21415af82c1df"
license "MIT"
depends_on "rust" => :build
def install
system "tar", "xvf", "pipe-rename-#{version}.crate", "--strip-components=1"
system "cargo", "install", *std_cargo_args
end
test do
touch "test.log"
(testpath/"rename.sh").write "#!/bin/sh\necho \"$(cat \"$1\").txt\" > \"$1\""
chmod "+x", testpath/"rename.sh"
ENV["EDITOR"] = testpath/"rename.sh"
system "#{bin}/renamer", "-y", "test.log"
assert_predicate testpath/"test.log.txt", :exist?
end
end