feat: add an env script that will configure the environment for using go with libflux (#16271)
parent
a05bd3ec39
commit
98a807c580
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
verbose_flag=""
|
||||
while getopts vx arg; do
|
||||
case "$arg" in
|
||||
v) verbose_flag="--verbose";;
|
||||
x) set -x;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
CGO_LDFLAGS=$(go run github.com/influxdata/flux/internal/cmd/flux-config --libs $verbose_flag)
|
||||
export CGO_LDFLAGS
|
||||
|
||||
# If this script is being executed, it will be executed under bash
|
||||
# so the bash source variable should be present. If the variable
|
||||
# matches the current script, then we are being executed and the
|
||||
# default argument should be to print the environment.
|
||||
if [ $# -eq 0 ] && [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
set -- env
|
||||
fi
|
||||
|
||||
if [ $# -gt 0 ]; then exec "$@"; fi
|
Loading…
Reference in New Issue