File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments