forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev
executable file
·21 lines (16 loc) · 618 Bytes
/
dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
set -euo pipefail
# Bump this counter to force rebuilding `dev` on all machines.
DEV_VERSION=19
THIS_DIR=$(cd "$(dirname "$0")" && pwd)
BINARY_DIR=$THIS_DIR/bin/dev-versions
BINARY_PATH=$BINARY_DIR/dev.$DEV_VERSION
if [[ ! -f "$BINARY_PATH" || ! -z "${DEV_FORCE_REBUILD-}" ]]; then
echo "$BINARY_PATH not found, building..."
mkdir -p $BINARY_DIR
bazel build //pkg/cmd/dev --config nonogo
cp $(bazel info bazel-bin --config nonogo)/pkg/cmd/dev/dev_/dev $BINARY_PATH
# The Bazel-built binary won't have write permissions.
chmod a+w $BINARY_PATH
fi
exec $BINARY_PATH "$@"