Skip to content

Commit da518f3

Browse files
committed
Install autocompletion files
Hopefully this will work
1 parent f66505a commit da518f3

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

.goreleaser.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ archives:
3636
windows: Windows
3737
386: i386
3838
amd64: x86_64
39+
files:
40+
- LICENSE
41+
- README.md
42+
- completions/bash_autocomplete
43+
- completions/zsh_autocomplete
3944
checksum:
4045
name_template: 'checksums.txt'
4146
snapshot:
@@ -53,3 +58,7 @@ brews:
5358
owner: GitJournal
5459
name: homebrew-tap
5560
token: "{{ .Env.TAP_GITHUB_TOKEN }}"
61+
install: |
62+
bin.install "git-auto-sync"
63+
bash_completion.install "completions/bash_autocomplete"
64+
zsh_completion.install "completions/zsh_autocomplete"

completions/bash_autocomplete

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/bash
22

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

55
_cli_bash_autocomplete() {
66
if [[ "${COMP_WORDS[0]}" != "source" ]]; then

completions/zsh_autocomplete

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
PROG=git-auto-sync
2+
_CLI_ZSH_AUTOCOMPLETE_HACK=1
3+
14
#compdef $PROG
25

36
_cli_zsh_autocomplete() {

main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212

1313
func main() {
1414
app := &cli.App{
15-
Name: "git-auto-sync",
16-
Usage: "Automatically Sync any Git Repo",
15+
Name: "git-auto-sync",
16+
Usage: "Automatically Sync any Git Repo",
17+
EnableBashCompletion: true,
1718
Commands: []*cli.Command{
1819
{
1920
Name: "watch",

0 commit comments

Comments
 (0)