Skip to content

Commit

Permalink
ref(shellcheck): Fix more offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
cdalvaro committed Oct 29, 2024
1 parent 8063526 commit 985d986
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions assets/runtime/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SELF_MANAGED_BLOCK_STRING="## cdalvaro managed block"
#----------------------------------------------------------------------------------------------------------------------
function exec_as_salt() {
if [[ $(whoami) == "${SALT_USER}" ]]; then
$@
"$@"
else
sudo -HEu "${SALT_USER}" "$@"
fi
Expand Down Expand Up @@ -110,7 +110,8 @@ function update_template() {
(
export "${VARIABLES[@]}"
local IFS=":"
sudo -HEu "${USR}" envsubst "${VARIABLES[*]/#/$}" <"${tmp_file}" | sudo tee "${FILE}"
# shellcheck disable=SC2024
sudo -HEu "${USR}" envsubst "${VARIABLES[*]/#/$}" <"${tmp_file}" >"${FILE}"
)

rm -f "${tmp_file}"
Expand Down Expand Up @@ -556,6 +557,7 @@ function configure_salt_minion() {

# Get master's fingerprint
log_info " ==> Getting master's fingerprint ..."
# shellcheck disable=SC2034
SALT_MASTER_FINGERPRINT="$(salt-key -f master.pub | grep -Ei 'master.pub: ([^\s]+)' | awk '{print $2}')"

# Update main configuration
Expand Down Expand Up @@ -786,7 +788,7 @@ function install_python_additional_packages() {

if [[ -n "${PYTHON_PACKAGES}" ]]; then
IFS=" " read -ra PYTHON_PACKAGES <<<"${PYTHON_PACKAGES}"
log_info "Installing additional python packages: ${PYTHON_PACKAGES[@]} ..."
log_info "Installing additional python packages: ${PYTHON_PACKAGES[*]} ..."
salt-pip install --no-cache-dir "${PYTHON_PACKAGES[@]}"
return $?
fi
Expand Down

0 comments on commit 985d986

Please sign in to comment.