Skip to content

Commit 1d426a5

Browse files
committed
Fix sureraldb installation scripts to always prefix version numbers with "v"
1 parent 0f1e79a commit 1d426a5

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

.devcontainer/surrealdb/install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ elif [ "$VERSION" = "latest" ]; then
4444
# For latest, don't pass any version flags - let the script use the default
4545
INSTALL_ARGS=""
4646
else
47-
# For specific versions, remove the "v" prefix if present and pass --version flag
48-
VERSION_CLEAN="${VERSION#v}"
49-
INSTALL_ARGS="--version $VERSION_CLEAN"
47+
# For specific versions, ensure the "v" prefix is present
48+
if [[ "$VERSION" == v* ]]; then
49+
# Already has "v" prefix
50+
VERSION_WITH_V="$VERSION"
51+
else
52+
# Add "v" prefix
53+
VERSION_WITH_V="v$VERSION"
54+
fi
55+
INSTALL_ARGS="--version $VERSION_WITH_V"
5056
fi
5157

5258
curl -sSf https://install.surrealdb.com | sh -s -- $INSTALL_ARGS

destination-surrealdb/.devcontainer/surrealdb/install.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,15 @@ elif [ "$VERSION" = "latest" ]; then
4444
# For latest, don't pass any version flags - let the script use the default
4545
INSTALL_ARGS=""
4646
else
47-
# For specific versions, remove the "v" prefix if present and pass --version flag
48-
VERSION_CLEAN="${VERSION#v}"
49-
INSTALL_ARGS="--version $VERSION_CLEAN"
47+
# For specific versions, ensure the "v" prefix is present
48+
if [[ "$VERSION" == v* ]]; then
49+
# Already has "v" prefix
50+
VERSION_WITH_V="$VERSION"
51+
else
52+
# Add "v" prefix
53+
VERSION_WITH_V="v$VERSION"
54+
fi
55+
INSTALL_ARGS="--version $VERSION_WITH_V"
5056
fi
5157

5258
curl -sSf https://install.surrealdb.com | sh -s -- $INSTALL_ARGS

0 commit comments

Comments
 (0)