Better autocompletion msg (#3481)

This commit also removes checking for msgp generated files since snap
command is not merged yet.

msgp check will be added in snap change.
This commit is contained in:
Anis Elleuch
2020-11-12 16:27:05 -08:00
committed by GitHub
parent 6ab70467cc
commit e216394765
2 changed files with 10 additions and 8 deletions
+1 -6
View File
@@ -19,21 +19,16 @@ checks:
getdeps:
@mkdir -p ${GOPATH}/bin
@which golangci-lint 1>/dev/null || (echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.27.0)
@which msgp 1>/dev/null || (echo "Installing msgp" && go get github.com/tinylib/msgp)
@which stringer 1>/dev/null || (echo "Installing stringer" && go get golang.org/x/tools/cmd/stringer)
crosscompile:
@(env bash $(PWD)/buildscripts/cross-compile.sh)
verifiers: getdeps vet fmt lint check-gen
verifiers: getdeps vet fmt lint
docker: build
@docker build -t $(TAG) . -f Dockerfile.dev
check-gen:
@go generate ./... >/dev/null
@(! git diff --name-only | grep '_gen.go$$') || (echo "Non-committed changes in auto-generated code is detected, please commit them to proceed." && false)
vet:
@echo "Running $@"
@GO111MODULE=on go vet github.com/minio/mc/...
+9 -2
View File
@@ -252,8 +252,15 @@ func installAutoCompletion() {
return
}
shellName := os.Getenv("SHELL")
if shellName == "" {
shellName = "$SHELL"
} else {
shellName = filepath.Base(shellName)
}
if completeinstall.IsInstalled(filepath.Base(os.Args[0])) || completeinstall.IsInstalled("mc") {
console.Infoln("autocompletion is already enabled in your '$SHELLRC'")
console.Infoln("autocompletion is already enabled in your '" + shellName + "' shell.")
return
}
@@ -261,7 +268,7 @@ func installAutoCompletion() {
if err != nil {
fatalIf(probe.NewError(err), "Unable to install auto-completion.")
} else {
console.Infoln("enabled autocompletion in '$SHELLRC'. Please restart your shell.")
console.Infoln("enabled autocompletion in your '" + shellName + "' rc file. Please restart your shell.")
}
}