Skip to content

Commit 27519f6

Browse files
committed
chore: fix shellcheck lints
Signed-off-by: Tyler Gillson <[email protected]>
1 parent 1e1db3e commit 27519f6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Copyright Contributors to the Open Cluster Management project
21
#!/usr/bin/env bash
2+
# Copyright Contributors to the Open Cluster Management project
33

44
# Clusteradm CLI location
5-
: ${INSTALL_DIR:="/usr/local/bin"}
5+
: "${INSTALL_DIR:=/usr/local/bin}"
66

77
# sudo is required to copy binary to INSTALL_DIR for linux
8-
: ${USE_SUDO:="false"}
8+
: "${USE_SUDO:=false}"
99

1010
# Http request CLI
1111
HTTP_REQUEST_CLI=curl
@@ -27,7 +27,7 @@ getSystemInfo() {
2727
x86_64) ARCH="amd64";;
2828
esac
2929

30-
OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')
30+
OS=$(uname | tr '[:upper:]' '[:lower:]')
3131

3232
# Most linux distro needs root permission to copy the file to /usr/local/bin
3333
if [[ "$OS" == "linux" || "$OS" == "darwin" ]] && [ "$INSTALL_DIR" == "/usr/local/bin" ]; then
@@ -73,7 +73,7 @@ checkExisting() {
7373
runAsRoot() {
7474
local CMD="$*"
7575

76-
if [ $EUID -ne 0 -a $USE_SUDO = "true" ]; then
76+
if [ "$EUID" -ne 0 ] && [ "$USE_SUDO" = "true" ]; then
7777
CMD="sudo $CMD"
7878
fi
7979

@@ -139,7 +139,7 @@ installFile() {
139139
exit 1
140140
fi
141141

142-
chmod o+x $tmp_root_cli
142+
chmod o+x "$tmp_root_cli"
143143
runAsRoot cp "$tmp_root_cli" "$INSTALL_DIR"
144144

145145
if [ -f "$CLI_FILE" ]; then
@@ -189,7 +189,7 @@ checkExisting
189189

190190
echo "Installing $TARGET_VERSION OCM clusteradm CLI..."
191191

192-
downloadFile $TARGET_VERSION
192+
downloadFile "$TARGET_VERSION"
193193
installFile
194194
cleanup
195195

0 commit comments

Comments
 (0)