Skip to content

Commit bb75415

Browse files
committed
allow user to specify install version in env var
1 parent d561d0d commit bb75415

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/bin/install

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,16 @@ if [[ "$1" == "-y" ]] || [[ "$CI" == "1" ]] || [[ "$CI" == "true" ]]; then
2424
CI="1"
2525
fi
2626

27+
# check if DEFANG_INSTALL_VERSION is set and set the release path accordingly
28+
if [[ -z "$DEFANG_INSTALL_VERSION" ]]; then
29+
RELEASE_PATH="/latest"
30+
else
31+
RELEASE_PATH="/tags/$DEFANG_INSTALL_VERSION"
32+
fi
33+
2734
# Use curl to fetch the latest release data
2835
echo "Fetching the latest release information..."
29-
RELEASE_JSON=$(curl -s -L https://api.github.com/repos/DefangLabs/defang/releases/latest)
36+
RELEASE_JSON=$(curl -s -L https://api.github.com/repos/DefangLabs/defang/releases$RELEASE_PATH)
3037

3138
# Check for curl failure
3239
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)