|
| 1 | +class S5cmd < Formula |
| 2 | + desc "Parallel S3 and local filesystem execution tool" |
| 3 | + homepage "https://github.com/peak/s5cmd/" |
| 4 | + url "https://github.com/peak/s5cmd/archive/refs/tags/v2.3.0.tar.gz" |
| 5 | + sha256 "6910763a7320010aa75fe9ef26f622e440c2bd6de41afdbfd64e78c158ca19d4" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/peak/s5cmd.git", branch: "master" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "916e4d04783629cfd49481c1f6aa50ea3cde6f77a3083ff0f297e55c73e5bb79" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "916e4d04783629cfd49481c1f6aa50ea3cde6f77a3083ff0f297e55c73e5bb79" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "916e4d04783629cfd49481c1f6aa50ea3cde6f77a3083ff0f297e55c73e5bb79" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "9c2d0641ad6fcef280e6120b699cd5118d123b797ab6c8106921573146d72070" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "9c2d0641ad6fcef280e6120b699cd5118d123b797ab6c8106921573146d72070" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "0fb0bbbf11a900fb389b607b57acbc203a50bff71b0913a66b6308e658913dee" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + ldflags = %W[ |
| 22 | + -s -w |
| 23 | + -X=github.com/peak/s5cmd/v2/version.Version=#{version} |
| 24 | + -X=github.com/peak/s5cmd/v2/version.GitCommit=#{tap.user} |
| 25 | + ] |
| 26 | + system "go", "build", *std_go_args(ldflags:) |
| 27 | + generate_completions_from_executable(bin/"s5cmd", "--install-completion") |
| 28 | + end |
| 29 | + |
| 30 | + test do |
| 31 | + assert_match "no valid providers in chain", shell_output("#{bin}/s5cmd --retry-count 0 ls s3://brewtest 2>&1", 1) |
| 32 | + assert_match version.to_s, shell_output("#{bin}/s5cmd version") |
| 33 | + end |
| 34 | +end |
0 commit comments