mirror of https://github.com/linkerd/linkerd2.git
25 lines
441 B
Bash
Executable File
25 lines
441 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
bindir=$( cd "${0%/*}" && pwd )
|
|
rootdir=$( cd "$bindir"/.. && pwd )
|
|
|
|
system=$(uname -s)
|
|
|
|
if [ "$system" = Darwin ]; then
|
|
bin=$rootdir/target/cli/darwin/linkerd
|
|
elif [ "$system" = Linux ]; then
|
|
bin=$rootdir/target/cli/linux/linkerd
|
|
else
|
|
echo "unknown system: $system" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# build linkerd executable if it does not exist
|
|
if [ ! -f "$bin" ]; then
|
|
"$bindir"/build-cli-bin >/dev/null
|
|
fi
|
|
|
|
exec "$bin" "$@"
|