homebrew-core/Formula/onefetch.rb

20 lines
723 B
Ruby
Raw Normal View History

class Onefetch < Formula
desc "Git repository summary on your terminal"
homepage "https://github.com/o2sh/onefetch"
url "https://github.com/o2sh/onefetch/archive/v1.6.5.tar.gz"
sha256 "50f069db2fa713024a19bf708add7812f3420b0c107eb68cd9907d76e375a06d"
depends_on "rust" => :build
def install
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
end
test do
system "#{bin}/onefetch", "--help"
assert_match "onefetch " + version.to_s, shell_output("#{bin}/onefetch -V").chomp
system "git init && echo \"puts 'Hello, world'\" > main.rb && git add main.rb && git commit -m \"First commit\""
assert_match /Language:.*Ruby/, shell_output("#{bin}/onefetch").chomp
end
end