github.com/lestrrat-go/jwx/v2@v2.0.21/tools/cmd/install-jwx.sh (about)

     1  #!/bin/bash
     2  
     3  set -e
     4  
     5  # find where to install. GOBIN or GOPATH/bin
     6  
     7  install_dir="$(go env GOBIN)"
     8  if [[ -z "$install_dir" ]]; then
     9  	install_dir=$(go env GOPATH)/bin
    10  fi
    11  
    12  # make sure the directory exists
    13  
    14  mkdir -p "$install_dir"
    15  
    16  pushd cmd/jwx > /dev/null
    17  
    18  go build -o "$install_dir/jwx" .
    19  
    20  popd > /dev/null
    21  
    22  echo "Installed jwx in $install_dir/jwx"