Skip to content

Commit

Permalink
Fix shellcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubrak committed Dec 13, 2024
1 parent 563e7aa commit 567db21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_file_content(self, address: str, file: Path) -> CommandResult:
return self.executor.execute(address, "type", str(file))

def file_exists(self, address: str, file: Path) -> CommandResult:
# Windows needs double quoting for passing paths containing
# Windows needs double quoting for passing paths
# containing spaces, single quotes don't work
return self.executor.execute(
address, f'if exist "{file}" (exit 0) else (exit 1)')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ INSTALL_DIR="${DEFAULT_INSTALL_DIR}"

parseParams() {
while [ $# -gt 0 ]; do
# shellcheck disable=SC2039
local param="${1}"
if [ "${param}" = "--version" ]; then
printf "%s\n" "${INSTALLER_VERSION}"
Expand All @@ -39,13 +40,15 @@ parseParams() {
}

uninstall() {
# shellcheck disable=SC2039
local uninstallScript="${INSTALL_DIR}/agent/${UNINSTALL_SCRIPT}"
if [ -f "${uninstallScript}" ]; then
"${uninstallScript}"
fi
}

deployOneagentCtl() {
# shellcheck disable=SC2039
local ONEAGENTCTL_DIR="${INSTALL_DIR}/agent/tools"
mkdir -p "${ONEAGENTCTL_DIR}"
mkdir -p "${DEPLOYMENT_CONF_PATH}"
Expand All @@ -54,14 +57,15 @@ deployOneagentCtl() {
}

deployUninstallScript() {
# shellcheck disable=SC2039
local UNINSTALL_DIR="${INSTALL_DIR}/agent"
mkdir -p "${UNINSTALL_DIR}"
printf '%s' "${UNINSTALL_CODE}" > "${UNINSTALL_DIR}/${UNINSTALL_SCRIPT}"
chmod +x "${UNINSTALL_DIR}/${UNINSTALL_SCRIPT}"
}

applyConfig() {
"${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" ${CTL_PARAMS}
"${INSTALL_DIR}/agent/tools/${ONEAGENTCTL_BIN}" "${CTL_PARAMS}"
}

main() {
Expand Down

0 comments on commit 567db21

Please sign in to comment.