Skip to content

Commit

Permalink
seqkit: add completion support and version check
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Dec 4, 2024
1 parent bf76423 commit 16f97f8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Formula/s/seqkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,21 @@ class Seqkit < Formula

def install
system "go", "build", *std_go_args(ldflags: "-s -w"), "./seqkit"

# generate_completions_from_executable(bin/"seqkit", "genautocomplete", "--shell")
# We do this because the command to generate completions doesn't print them
# to stdout and only writes them to a file
system bin/"seqkit", "genautocomplete", "--shell", "bash", "--file", "seqkit.bash"
system bin/"seqkit", "genautocomplete", "--shell", "zsh", "--file", "_seqkit"
system bin/"seqkit", "genautocomplete", "--shell", "fish", "--file", "seqkit.fish"
bash_completion.install "seqkit.bash" => "seqkit"
zsh_completion.install "_seqkit"
fish_completion.install "seqkit.fish"
end

test do
assert_match version.to_s, shell_output("#{bin}/seqkit version")

resource "homebrew-testdata" do
url "https://raw.githubusercontent.com/shenwei356/seqkit/e37d70a7e0ca0e53d6dbd576bd70decac32aba64/tests/seqs4amplicon.fa"
sha256 "b0f09da63e3c677cc698d5cdff60e2d246368263c22385937169a9a4c321178a"
Expand Down

0 comments on commit 16f97f8

Please sign in to comment.