Move completions generation from goreleaser to Makefile
This commit is contained in:
parent
be45eedc18
commit
80f91af171
2 changed files with 17 additions and 6 deletions
|
|
@ -9,10 +9,7 @@ before:
|
|||
hooks:
|
||||
- go mod tidy
|
||||
- make manpages GH_VERSION={{.Version}}
|
||||
- mkdir -p ./share/bash-completion/completions ./share/fish/vendor_completions.d ./share/zsh/site-functions
|
||||
- sh -c "go run ./cmd/gh completion -s bash > ./share/bash-completion/completions/gh"
|
||||
- sh -c "go run ./cmd/gh completion -s fish > ./share/fish/vendor_completions.d/gh.fish"
|
||||
- sh -c "go run ./cmd/gh completion -s zsh > ./share/zsh/site-functions/_gh"
|
||||
- make completions
|
||||
|
||||
builds:
|
||||
- <<: &build_defaults
|
||||
|
|
|
|||
18
Makefile
18
Makefile
|
|
@ -27,6 +27,13 @@ clean: script/build
|
|||
manpages: script/build
|
||||
@script/build $@
|
||||
|
||||
.PHONY: completions
|
||||
completions:
|
||||
mkdir -p ./share/bash-completion/completions ./share/fish/vendor_completions.d ./share/zsh/site-functions
|
||||
go run ./cmd/gh completion -s bash > ./share/bash-completion/completions/gh
|
||||
go run ./cmd/gh completion -s fish > ./share/fish/vendor_completions.d/gh.fish
|
||||
go run ./cmd/gh completion -s zsh > ./share/zsh/site-functions/_gh
|
||||
|
||||
# just a convenience task around `go test`
|
||||
.PHONY: test
|
||||
test:
|
||||
|
|
@ -60,15 +67,22 @@ endif
|
|||
DESTDIR :=
|
||||
prefix := /usr/local
|
||||
bindir := ${prefix}/bin
|
||||
mandir := ${prefix}/share/man
|
||||
datadir := ${prefix}/share
|
||||
mandir := ${datadir}/man
|
||||
|
||||
.PHONY: install
|
||||
install: bin/gh manpages
|
||||
install: bin/gh manpages completions
|
||||
install -d ${DESTDIR}${bindir}
|
||||
install -m755 bin/gh ${DESTDIR}${bindir}/
|
||||
install -d ${DESTDIR}${mandir}/man1
|
||||
install -m644 ./share/man/man1/* ${DESTDIR}${mandir}/man1/
|
||||
install -DT -m644 ./share/bash-completion/completions/gh ${DESTDIR}${datadir}/bash-completion/completions/gh
|
||||
install -DT -m644 ./share/fish/vendor_completions.d/gh.fish ${DESTDIR}${datadir}/fish/vendor_completions.d/gh.fish
|
||||
install -DT -m644 ./share/zsh/site-functions/_gh ${DESTDIR}${datadir}/zsh/site-functions/_gh
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall:
|
||||
rm -f ${DESTDIR}${bindir}/gh ${DESTDIR}${mandir}/man1/gh.1 ${DESTDIR}${mandir}/man1/gh-*.1
|
||||
rm -f ${DESTDIR}${datadir}/bash-completion/completions/gh
|
||||
rm -f ${DESTDIR}${datadir}/fish/vendor_completions.d/gh.fish
|
||||
rm -f ${DESTDIR}${datadir}/zsh/site-functions/_gh
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue