Redirection install-cli.sh
# the platform is not supported.
#
# Environment variables:
-# - INSTALL_DIRECTORY (optional): defaults to $GOPATH/bin
+# - INSTALL_DIRECTORY (optional): defaults to $GOPATH/bin (if $GOPATH exists)
+# or /usr/local/bin (else)
# - CLI_RELEASE_TAG (optional): defaults to fetching the latest release
#
# You can install using this script:
@@ -64,7 +65,10 @@ downloadFile() {
}
findGoBinDirectory() {
- EFFECTIVE_GOPATH=$(go env GOPATH)
+ if [ -z "$GOPATH" ]; then
+ eval "$1='/usr/local/bin'"
+ else
+ EFFECTIVE_GOPATH="$GOPATH"
# CYGWIN: Convert Windows-style path into sh-compatible path
if [ "$OS_CYGWIN" = "1" ]; then
EFFECTIVE_GOPATH=$(cygpath "$EFFECTIVE_GOPATH")
@@ -81,6 +85,7 @@ findGoBinDirectory() {
exit 1
fi
eval "$1='$GOBIN'"
+ fi
}
initArch() {
