From b74cd30fd7b0ebf30ef570f7bfa78dfcd62d80d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henry-Joseph=20Aud=C3=A9oud?= Date: Fri, 30 Oct 2020 11:41:52 +0100 Subject: bash-completion: add completion script --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e21b512..2817034 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,7 @@ lint: $(BIN)/golint $(BIN)/staticcheck $(BIN)/misspell go list ./... | xargs -L1 golint -set_exit_status staticcheck ./... misspell -source=text $(FILES) + shellcheck -s bash cmd/fscrypt/fscrypt_bash_completion ( cd cli-tests && shellcheck -x *.sh) clean: @@ -158,8 +159,8 @@ coverage.out: $(BIN)/gocovmerge $(COVERAGE_FILES) @go test -coverpkg=./... -covermode=count -coverprofile=$@ -p 1 ./$* 2> /dev/null ###### Installation Commands (require sudo) ##### -.PHONY: install install-bin install-pam uninstall -install: install-bin install-pam +.PHONY: install install-bin install-pam uninstall install-completion +install: install-bin install-pam install-completion PREFIX := /usr/local BINDIR := $(PREFIX)/bin @@ -181,10 +182,16 @@ install-pam: $(PAM_MODULE) install -d $(DESTDIR)$(PAM_CONFIG_DIR) install $(PAM_CONFIG) $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME) +COMPLETION_INSTALL_DIR := $(PREFIX)/share/bash-completion/completions + +install-completion: cmd/fscrypt/fscrypt_bash_completion + install -Dm644 $< $(DESTDIR)$(COMPLETION_INSTALL_DIR)/fscrypt + uninstall: rm -f $(DESTDIR)$(BINDIR)/$(NAME) \ $(DESTDIR)$(PAM_INSTALL_PATH) \ - $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME) + $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME) \ + $(DESTDIR)$(COMPLETION_INSTALL_DIR)/fscrypt #### Tool Building Commands #### TOOLS := $(addprefix $(BIN)/,protoc golint protoc-gen-go goimports staticcheck gocovmerge misspell) -- cgit v1.2.3