Skip to content

Commit 5e00a11

Browse files
committed
fix: Improve release tag extraction to avoid issues with some curl version
1 parent 2f7cdef commit 5e00a11

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

apps/website/public/install.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ detect_version() {
1616
echo "Detecting latest stable version from GitHub..." >&2
1717

1818
# Try to get latest release from GitHub by following redirects
19-
version=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
20-
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null | \
21-
sed 's#.*/tag/##')
19+
effective_url=$(curl -fsSL -o /dev/null -w '%{url_effective}\n' \
20+
https://github.com/dokploy/dokploy/releases/latest 2>/dev/null)
2221

23-
# Fallback to latest tag if detection fails
24-
if [ -z "$version" ]; then
22+
# Extract tag from URL (format: .../releases/tag/v0.x.x)
23+
if echo "$effective_url" | grep -q '/tag/'; then
24+
version=$(echo "$effective_url" | sed 's#.*/tag/##')
25+
fi
26+
27+
# Validate version looks like a tag (starts with 'v' or is a valid semver)
28+
if [ -z "$version" ] || echo "$version" | grep -q '^http'; then
2529
echo "Warning: Could not detect latest version from GitHub, using fallback version latest" >&2
2630
version="latest"
2731
else

0 commit comments

Comments
 (0)