Skip to content

Commit bae2f6c

Browse files
committed
chore: add usage, make 'v' prefix less fragile
Signed-off-by: Tyler Gillson <[email protected]>
1 parent 7ba4494 commit bae2f6c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

install.sh

100644100755
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#!/usr/bin/env bash
22
# Copyright Contributors to the Open Cluster Management project
3+
#
4+
# Usage: ./install.sh [version]
5+
#
6+
# If no version is provided, the latest version will be installed.
7+
# If a version is provided, it will be installed.
8+
#
9+
# Example: ./install.sh v0.1.0
10+
# Example: ./install.sh latest
311

412
# Clusteradm CLI location
513
: "${INSTALL_DIR:=/usr/local/bin}"
@@ -186,7 +194,11 @@ checkHttpRequestCLI
186194
if [ -z "$1" ]; then
187195
TARGET_VERSION="latest"
188196
else
189-
TARGET_VERSION=v$1
197+
if [[ "$1" =~ ^v.* ]]; then
198+
TARGET_VERSION="$1"
199+
else
200+
TARGET_VERSION="v$1"
201+
fi
190202
fi
191203

192204
verifySupported

0 commit comments

Comments
 (0)