homebrew-core/Formula/watchexec.rb

22 lines
617 B
Ruby
Raw Normal View History

class Watchexec < Formula
desc "Execute commands when watched files change"
homepage "https://github.com/mattgreen/watchexec"
url "https://github.com/mattgreen/watchexec/archive/1.6.0.tar.gz"
sha256 "0ce7b26bbc05400a835b5a06e13ef69aac90a6d93ef4b989241258494f3c967f"
depends_on "rust" => :build
def install
system "cargo", "build", "--release"
bin.install "target/release/watchexec"
man1.install "doc/watchexec.1"
end
test do
o = IO.popen("#{bin}/watchexec -- echo 'saw file change'")
sleep 0.1
Process.kill("INT", o.pid)
assert_match "saw file change", o.read
end
end