dufs 0.31.0 (new formula)
Closes #118734. Signed-off-by: Rui Chen <rui@chenrui.dev> Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>master
parent
08e7183dcc
commit
d90e490c43
|
@ -0,0 +1,32 @@
|
|||
class Dufs < Formula
|
||||
desc "Static file server"
|
||||
homepage "https://github.com/sigoden/dufs"
|
||||
url "https://github.com/sigoden/dufs/archive/refs/tags/v0.31.0.tar.gz"
|
||||
sha256 "f5078fb245d0aeccbcfe966a0aa89fb2ee5af7a88016534ab66776971c0c3d2e"
|
||||
license any_of: ["Apache-2.0", "MIT"]
|
||||
|
||||
depends_on "rust" => :build
|
||||
|
||||
def install
|
||||
system "cargo", "install", *std_cargo_args
|
||||
|
||||
generate_completions_from_executable(bin/"dufs", "--completions")
|
||||
end
|
||||
|
||||
test do
|
||||
port = free_port
|
||||
pid = fork do
|
||||
exec "#{bin}/dufs", bin.to_s, "-b", "127.0.0.1", "--port", port.to_s
|
||||
end
|
||||
|
||||
sleep 2
|
||||
|
||||
begin
|
||||
read = (bin/"dufs").read
|
||||
assert_equal read, shell_output("curl localhost:#{port}/dufs")
|
||||
ensure
|
||||
Process.kill("SIGINT", pid)
|
||||
Process.wait(pid)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue