Skip to content

Commit 500643d

Browse files
committed
Installing envsubstr and clusterawsadm into bin
1 parent 635e993 commit 500643d

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

devbox.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
],
1616
"shell": {
1717
"init_hook": [
18+
"export PATH=$PWD/bin:$PATH",
1819
"./scripts/devbox-init-hook.sh"
1920
],
2021
"scripts": {

scripts/devbox-init-hook.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
33
SRC_DIR="$(dirname $DIR)"
44

5-
# Set install path to devbox packages directory
6-
INSTALL_DIR="$DEVBOX_PACKAGES_DIR/bin"
5+
# Set install path
6+
INSTALL_DIR="$SRC_DIR/bin"
7+
mkdir -p "$INSTALL_DIR"
78

89
if [[ ! -f "$INSTALL_DIR/envsubst" ]]; then
9-
ENVSUBST_VERSION="v1.4.3"
10-
URL="https://github.com/a8m/envsubst/releases/download/$ENVSUBST_VERSION/envsubst-$(uname -s)-$(uname -m)"
11-
echo "Downloading: $URL"
12-
echo "Installing github.com/a8m/envsubst into Devbox shell"
13-
sudo curl -sL $URL -o $INSTALL_DIR/envsubst
14-
sudo chmod +x "$INSTALL_DIR/envsubst"
10+
echo "Installing github.com/a8m/envsubst into bin"
11+
make -C "$SRC_DIR/hack/tools" bin/envsubst
12+
ln -s "$SRC_DIR/hack/tools/bin/envsubst" "$INSTALL_DIR/envsubst"
1513

1614
# Verify installation
1715
if ! command -v envsubst &>/dev/null; then
@@ -21,7 +19,7 @@ if [[ ! -f "$INSTALL_DIR/envsubst" ]]; then
2119
fi
2220

2321
# Use build location by default
24-
if [[ ! -L "$INSTALL_DIR/clusterawsadm" ]]; then
25-
echo "Linking [$SRC_DIR/bin/clusterawsadm] [$INSTALL_DIR/clusterawsadm]"
26-
sudo ln -s "$SRC_DIR/bin/clusterawsadm" $INSTALL_DIR/clusterawsadm
22+
if [[ ! -f "$INSTALL_DIR/clusterawsadm" ]]; then
23+
echo "Installing clusterawsadm into bin"
24+
make -C "$SRC_DIR" clusterawsadm
2725
fi

0 commit comments

Comments
 (0)