Skip to content

Commit

Permalink
feat: Generate shell completions on install
Browse files Browse the repository at this point in the history
Homebrew can automatically generate and install completions for bash,
zsh, and fish. For now, completion is limited to bash and zsh until
graphite adds fish support.

This simplifies the installation steps for homebrew users.
  • Loading branch information
jalaziz committed Oct 12, 2022
1 parent af77592 commit 31746b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Formula/graphite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Graphite < Formula
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]

generate_completions_from_executable(libexec/"bin/gt", "completion", shells: [:bash, :zsh])
end

test do
Expand Down
2 changes: 2 additions & 0 deletions formula-templates/graphite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Graphite < Formula
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]

generate_completions_from_executable(libexec/"bin/gt", "completion", shells: [:bash, :zsh])
end

test do
Expand Down

0 comments on commit 31746b5

Please sign in to comment.