-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from nao1215/nchika/shipping-completion
Feat: Integrate completions into Homebrew formula (Issue #168)
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ | |
gup | ||
dist | ||
cover.* | ||
/completions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ before: | |
hooks: | ||
- go mod tidy | ||
- go generate ./... | ||
- ./scripts/completions.sh | ||
builds: | ||
- main: . | ||
ldflags: | ||
|
@@ -20,6 +21,8 @@ archives: | |
format_overrides: | ||
- goos: windows | ||
format: zip | ||
files: | ||
- completions/* | ||
checksum: | ||
name_template: "checksums.txt" | ||
snapshot: | ||
|
@@ -31,14 +34,27 @@ changelog: | |
- "^docs:" | ||
- "^test:" | ||
nfpms: | ||
- maintainer: Naohiro CHIKAMATSU <[email protected]> | ||
- maintainer: 'Naohiro CHIKAMATSU <[email protected]>' | ||
description: gup - Update binaries installed by 'go install' | ||
homepage: https://github.com/nao1215/gup | ||
license: Apache License 2.0 | ||
formats: | ||
- deb | ||
- rpm | ||
- apk | ||
contents: | ||
- src: ./completions/gup.bash | ||
dst: /usr/share/bash-completion/completions/gup | ||
file_info: | ||
mode: 0644 | ||
- src: ./completions/gup.fish | ||
dst: /usr/share/fish/vendor_completions.d/gup.fish | ||
file_info: | ||
mode: 0644 | ||
- src: ./completions/gup.zsh | ||
dst: /usr/share/zsh/vendor-completions/_gup | ||
file_info: | ||
mode: 0644 | ||
brews: | ||
- name: gup | ||
description: gup - Update binaries installed by 'go install' | ||
|
@@ -47,3 +63,9 @@ brews: | |
owner: nao1215 | ||
name: homebrew-tap | ||
token: "{{ .Env.TAP_GITHUB_TOKEN }}" | ||
# Ref. https://carlosbecker.com/posts/golang-completions-cobra/ | ||
install: |- | ||
bin.install "gup" | ||
bash_completion.install "completions/gup.bash" => "gup" | ||
zsh_completion.install "completions/gup.zsh" => "gup" | ||
fish_completion.install "completions/gup.fish" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
# scripts/completions.sh | ||
set -eux | ||
|
||
rm -rf completions | ||
mkdir completions | ||
|
||
for sh in bash zsh fish; do | ||
go run main.go completion "$sh" >"completions/gup.$sh" | ||
done |