-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provides maintained version of rip under new rip2 name Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
19d3f10
commit de1c53a
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class Rip < Formula | ||
desc "Safe and ergonomic alternative to rm" | ||
homepage "https://github.com/MilesCranmer/rip2" | ||
url "https://github.com/MilesCranmer/rip2/archive/refs/tags/v0.9.0.tar.gz" | ||
sha256 "e8519e21877c8883f9f2a700036c53bce62b5ee0afaef47a12780999457e2633" | ||
license "GPL-3.0-or-later" | ||
head "https://github.com/MilesCranmer/rip2.git", branch: "master" | ||
|
||
depends_on "rust" => :build | ||
|
||
def install | ||
system "cargo", "install", *std_cargo_args(path: ".") | ||
|
||
generate_completions_from_executable(bin/"rip", "completion") | ||
(share/"elvish/lib/rip.elv").write Utils.safe_popen_read(bin/"rip", "completions", "elvish") | ||
(share/"powershell/completions/_rip.ps1").write Utils.safe_popen_read(bin/"rip", "completions", "powershell") | ||
(share/"nu/completions/rip.nu").write Utils.safe_popen_read(bin/"rip", "completions", "nushell") | ||
end | ||
|
||
test do | ||
# Create a test file and verify rip can delete it | ||
test_file = testpath/"test.txt" | ||
touch test_file | ||
system bin/"rip", "--graveyard", testpath/"graveyard", test_file.to_s | ||
assert_predicate testpath/"graveyard", :exist? | ||
refute_predicate test_file, :exist? | ||
end | ||
end |