Skip to content

Commit 301d204

Browse files
btdu 0.7.2 (new formula)
1 parent c35a6d2 commit 301d204

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Formula/b/btdu.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class Btdu < Formula
2+
desc "Sampling disk usage profiler for btrfs"
3+
homepage "https://github.com/CyberShadow/btdu"
4+
url "https://github.com/CyberShadow/btdu/archive/refs/tags/v0.7.2.tar.gz"
5+
sha256 "695ded59fb2029c8ae48ca0f990e68928841cdf36a4cf4cbc2485460cadbbd67"
6+
license "GPL-2.0-only"
7+
8+
depends_on "btrfs-progs" => :build
9+
depends_on "dub" => :build
10+
depends_on "ldc" => :build
11+
uses_from_macos "ncurses"
12+
13+
def install
14+
system "dub", "build", "-b", "release", "--compiler=ldc2"
15+
bin.install "btdu"
16+
end
17+
18+
test do
19+
assert_match "Fatal error: No path specified", shell_output("#{bin}/btdu 2>&1", 1)
20+
# This would be how you actually test the program...but I believe Homebrew doesn't use sudo
21+
# system "dd", "if=/dev/zero", "of=testdisk", "bs=1M", "count=128"
22+
# system "mkfs.btrfs", "testdisk"
23+
# system "mkdir", "mnt"
24+
# system "sudo", "mount", "./testdisk", "mnt"
25+
# assert_match "Collected 500 samples", shell_output("sudo #{bin}/btdu --du -n 500 --headless mnt 2>&1")
26+
# system "sudo", "umount", "mnt"
27+
end
28+
end

0 commit comments

Comments
 (0)