File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 26
26
27
27
# check if DEFANG_INSTALL_VERSION is set and set the release path accordingly
28
28
if [[ -z "$DEFANG_INSTALL_VERSION" ]]; then
29
- RELEASE_PATH="/ latest"
29
+ RELEASE_PATH="latest"
30
30
else
31
- RELEASE_PATH="/ tags/$DEFANG_INSTALL_VERSION"
31
+ RELEASE_PATH="tags/$DEFANG_INSTALL_VERSION"
32
32
fi
33
33
34
- # Use curl to fetch the latest release data
35
- echo "Fetching the latest release information ..."
36
- RELEASE_JSON=$(curl -s -L https://api.github.com/repos/DefangLabs/defang/releases$RELEASE_PATH)
34
+ # Echo fetching the release path either latest or strip the tags/ from the version
35
+ echo "Fetching the ${DEFANG_INSTALL_VERSION:- latest} release of defang ..."
36
+ RELEASE_JSON=$(curl -s -f - L https://api.github.com/repos/DefangLabs/defang/releases/ $RELEASE_PATH)
37
37
38
38
# Check for curl failure
39
- if [ $? -ne 0 ]; then
40
- echo "Error fetching release information. Please check your connection or if the URL is correct."
39
+ if [ -z "$RELEASE_JSON" ]; then
40
+ echo "Error fetching release information. Please check your connection or if the version is correct."
41
41
return 1
42
42
fi
43
43
@@ -80,7 +80,7 @@ elif [ "$OS" = "Linux" ]; then
80
80
fi
81
81
82
82
# Download the file
83
- if ! curl -s -L "$DOWNLOAD_URL" -o "$FILENAME"; then
83
+ if ! curl -s -f - L "$DOWNLOAD_URL" -o "$FILENAME"; then
84
84
echo "Download failed. Please check your internet connection and try again."
85
85
return 4
86
86
fi
You can’t perform that action at this time.
0 commit comments