Skip to content

Commit

Permalink
Install autocompletion files
Browse files Browse the repository at this point in the history
Hopefully this will work
  • Loading branch information
vHanda committed May 11, 2022
1 parent f66505a commit da518f3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ archives:
windows: Windows
386: i386
amd64: x86_64
files:
- LICENSE
- README.md
- completions/bash_autocomplete
- completions/zsh_autocomplete
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -53,3 +58,7 @@ brews:
owner: GitJournal
name: homebrew-tap
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
install: |
bin.install "git-auto-sync"
bash_completion.install "completions/bash_autocomplete"
zsh_completion.install "completions/zsh_autocomplete"
2 changes: 1 addition & 1 deletion completions/bash_autocomplete
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/bash

: ${PROG:=$(basename ${BASH_SOURCE})}
PROG=git-auto-sync

_cli_bash_autocomplete() {
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
Expand Down
3 changes: 3 additions & 0 deletions completions/zsh_autocomplete
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PROG=git-auto-sync
_CLI_ZSH_AUTOCOMPLETE_HACK=1

#compdef $PROG

_cli_zsh_autocomplete() {
Expand Down
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import (

func main() {
app := &cli.App{
Name: "git-auto-sync",
Usage: "Automatically Sync any Git Repo",
Name: "git-auto-sync",
Usage: "Automatically Sync any Git Repo",
EnableBashCompletion: true,
Commands: []*cli.Command{
{
Name: "watch",
Expand Down

0 comments on commit da518f3

Please sign in to comment.