github.com/pachyderm/pachyderm@v1.13.4/etc/govars.sh (about)

     1  #!/bin/sh
     2  #
     3  # This is the bash version of govars.mk. It defines several common env variables
     4  # used by Pachyderm scripts (GOPATH, GOBIN, and PACHCTL), both so that other
     5  # scripts can be simplified by assuming these variables are set (after sourcing
     6  # this file) and so that those scripts work correctly on a variety of different
     7  # platforms (Linux, Darwin) and in a variety of different workflows.
     8  #
     9  # Because this script is sourced, it cannot assume bash and should be as
    10  # POSIX-compliant as possible.
    11  
    12  if test -z "${GOPATH}"
    13  then
    14    GOPATH=$(go env GOPATH)
    15    export GOPATH
    16  fi
    17  
    18  if test -z "${GOBIN}"
    19  then
    20    # Set GOBIN based on GOPATH (necessary on Windows)
    21    # TODO(msteffen) would it be better to use 'go env GOBIN'?
    22    GOBIN="${GOPATH}/bin"
    23    export GOBIN
    24  fi
    25  
    26  if test -z "${PACHCTL}"
    27  then
    28    # Set PACHCTL based on GOBIN (want compiled pachctl to override system
    29    # pachctl, if any)
    30    PACHCTL="${GOBIN}/pachctl"
    31    export PACHCTL
    32  fi