diff --git a/Makefile b/Makefile index 8243f74e..bec49e82 100644 --- a/Makefile +++ b/Makefile @@ -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/... diff --git a/cmd/main.go b/cmd/main.go index 8ec26156..6adea369 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -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.") } }