Skip to content

Commit 0ace1fa

Browse files
committed
fix spelling
1 parent 40234a1 commit 0ace1fa

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

cspell.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ignorePaths:
2828
- "**/test_data/**"
2929
- dist/**
3030
words:
31+
- armv
3132
- distroless
3233
- dynatrace
3334
- endef

install.bash

+30-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22

33
# The install script is based off of the Apache 2.0 licensed script from Helm,
4-
# the Kubernetes resouce manager: https://github.com/helm/helm.
4+
# the Kubernetes resource manager: https://github.com/helm/helm.
55

6-
GITHUB_REPOSITORY="nobl9/sloctl"
6+
PROGRAM_NAME="sloctl"
7+
GITHUB_REPOSITORY="nobl9/$PROGRAM_NAME"
78

8-
: "${BINARY_NAME:="sloctl"}"
9+
: "${BINARY_NAME:=$PROGRAM_NAME}"
910
: "${USE_SUDO:="true"}"
1011
: "${DEBUG:="false"}"
1112
: "${VERIFY_CHECKSUM:="true"}"
12-
: "${VERIFY_SIGNATURES:="false"}"
1313
: "${SLOCTL_INSTALL_DIR:="/usr/local/bin"}"
1414

1515
HAS_CURL="$(type "curl" &>/dev/null && echo true || echo false)"
@@ -197,33 +197,48 @@ testVersion() {
197197
set -e
198198
}
199199

200-
# help provides possible cli installation arguments
200+
# help provides possible cli installation arguments.
201201
help() {
202-
echo "Accepted cli arguments are:"
203-
echo -e "\t[--help|-h ] ->> prints this help"
204-
echo -e "\t[--version|-v <desired_version>] . When not defined it fetches the latest release from GitHub"
205-
echo -e "\te.g. --version v0.10.0"
206-
echo -e "\t[--no-sudo] ->> install without sudo"
202+
local script_name
203+
script_name=$(basename "$0")
204+
cat >&2 <<EOF
205+
Usage: ${script_name} [OPTS]
206+
An installer script for ${PROGRAM_NAME}!
207+
It can be used to both install the binary and upgrade an existing ${PROGRAM_NAME} version.
208+
OPTS:
209+
-h, --help Print this message
210+
--version, -v <desired_version> When not defined it fetches the latest release from GitHub
211+
--no-sudo Install without sudo
212+
ENV VARIABLES:
213+
BINARY_NAME Installed binary name, defaults to ${PROGRAM_NAME}
214+
USE_SUDO Whether to install with sudo, defaults to true
215+
DEBUG Print additional debug information, defaults to false
216+
VERIFY_CHECKSUM Verify the SHA256 checksum of the binary, defaults to true
217+
SLOCTL_INSTALL_DIR Install directory, defaults to /usr/local/bin
218+
Examples:
219+
SLOCTL_INSTALL_DIR=/home/me/go/bin ${script_name} --no-sudo --version=v0.10.0
220+
EOF
207221
}
208222

223+
# cleanup temporary files.
209224
cleanup() {
210225
if [[ -d "${SLOCTL_TMP_ROOT:-}" ]]; then
211226
rm -rf "$SLOCTL_TMP_ROOT"
212227
fi
213228
}
214229

215-
# Execution
230+
# Execution.
216231

217-
#Stop execution on any error
232+
# Stop execution on any error.
218233
trap "fail_trap" EXIT
219234
set -e
220235

221-
# Set debug if desired
236+
# Set debug if desired.
222237
if [ "${DEBUG}" == "true" ]; then
223238
set -x
224239
fi
225240

226-
# Parsing input arguments (if any)
241+
# Parsing input arguments (if any).
227242
export INPUT_ARGUMENTS="${*}"
228243
set -u
229244
while [[ $# -gt 0 ]]; do
@@ -256,6 +271,7 @@ while [[ $# -gt 0 ]]; do
256271
done
257272
set +u
258273

274+
# Run.
259275
initArch
260276
initOS
261277
verifySupported

0 commit comments

Comments
 (0)