github.com/cilium/controller-tools@v0.3.1-0.20230329170030-f2b7ff866fde/.run-controller-gen.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # This builds and runs controller-gen in a particular context
     4  # it's the equivalent of `go run sigs.k8s.io/controller-tools/cmd/controller-gen`
     5  # if you could somehow do that without modifying your go.mod.
     6  
     7  current_dir=$(pwd)
     8  if ! readlink -f . &>/dev/null; then
     9      echo "you're probably on OSX.  Please install gnu readlink -- otherwise you're missing the most useful readlink flag."
    10      exit 1
    11  fi
    12  
    13  cd $(dirname $(readlink -f ${BASH_SOURCE[0]}))
    14  go run -v -exec "./.run-in.sh ${current_dir} " ./cmd/controller-gen $@