-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathduck.rb
26 lines (23 loc) · 951 Bytes
/
duck.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Duck < Formula
desc "Command-line interface for Cyberduck (a multi-protocol file transfer tool)"
homepage "https://duck.sh/"
url "https://dist.duck.sh/nightly/duck-9.1.3.42742.tar.gz"
sha256 "a050d89377e38aca23344abf5406c523dd1855b9a9b0689ed4fea9a0c7a80099"
license "GPL-3.0-only"
depends_on "openjdk@17"
def install
# Because compiling would need a JDK and xcodebuild we just use the pre-compiled binary.
libexec.install Dir["*"]
rm_r "#{libexec}/Contents/PlugIns/Runtime.jre"
ln_s Formula["openjdk@17"].libexec/"openjdk.jdk", "#{libexec}/Contents/PlugIns/Runtime.jre"
bin.install_symlink "#{libexec}/Contents/MacOS/duck" => "duck"
end
test do
unless "Cyberduck 9.1.3 (42742)\n".eql? %x(`#{bin}/duck -version`)
raise "Version mismatch"
end
filename = (testpath/"test")
system "#{bin}/duck", "--download", stable.url, filename
filename.verify_checksum stable.checksum
end
end