|
| 1 | +class XCmd < Formula |
| 2 | + desc "Bootstrap 1000+ command-line tools in seconds" |
| 3 | + homepage "https://x-cmd.com" |
| 4 | + url "https://github.com/x-cmd/x-cmd/archive/refs/tags/v0.5.6.tar.gz" |
| 5 | + sha256 "7e60e2851d9eafd2474b17706fef9919a31eba5aacdfd79e8f4d488f477ca021" |
| 6 | + license all_of: ["AGPL-3.0-only", "MIT", "BSD-3-Clause"] |
| 7 | + |
| 8 | + head "https://github.com/x-cmd/x-cmd.git", branch: "X" |
| 9 | + |
| 10 | + bottle do |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "a9e9d45759eb975546409d87239bc4dc4481bfcf5ede5c671a41847d4e95179b" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "a9e9d45759eb975546409d87239bc4dc4481bfcf5ede5c671a41847d4e95179b" |
| 13 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "a9e9d45759eb975546409d87239bc4dc4481bfcf5ede5c671a41847d4e95179b" |
| 14 | + sha256 cellar: :any_skip_relocation, sonoma: "4412b5da947a0c7fdb8c2a29b931bbf6653a94d924c303532864d4649196673e" |
| 15 | + sha256 cellar: :any_skip_relocation, ventura: "4412b5da947a0c7fdb8c2a29b931bbf6653a94d924c303532864d4649196673e" |
| 16 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "a9e9d45759eb975546409d87239bc4dc4481bfcf5ede5c671a41847d4e95179b" |
| 17 | + end |
| 18 | + |
| 19 | + def install |
| 20 | + prefix.install Dir.glob("*") |
| 21 | + prefix.install Dir.glob(".x-cmd") |
| 22 | + inreplace prefix/"mod/x-cmd/lib/bin/x-cmd", "/opt/homebrew/Cellar/x-cmd/latest", prefix.to_s |
| 23 | + bin.install prefix/"mod/x-cmd/lib/bin/x-cmd" |
| 24 | + end |
| 25 | + |
| 26 | + test do |
| 27 | + assert_match "Welcome to x-cmd", shell_output("#{bin}/x-cmd 2>&1") |
| 28 | + assert_match "hello", shell_output("#{bin}/x-cmd cowsay hello") |
| 29 | + end |
| 30 | +end |
0 commit comments