mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Fix shellcheck warnings in shell scripts
- Fix SC2125: Quote GOPRIVATE/GONOSUMDB values in ci_setup.sh - Fix SC1091: Add source=/dev/null for dynamically sourced lib_luxd_clone.sh - Fix unbound variable errors in shellcheck.sh for arrays and args - Add -x flag to shellcheck for following sourced files
This commit is contained in:
@@ -15,6 +15,7 @@ EVM_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd )
|
||||
# TODO(marun) Support use of a released node image if using a release version of luxd
|
||||
|
||||
source "${EVM_PATH}"/scripts/constants.sh
|
||||
# shellcheck source=/dev/null
|
||||
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
|
||||
|
||||
clone_luxd "${LUX_VERSION}"
|
||||
|
||||
@@ -92,6 +92,7 @@ if ! docker pull "${LUXD_NODE_IMAGE}"; then
|
||||
LUXD_NODE_IMAGE="${LUXD_LOCAL_IMAGE_NAME}:${LUX_VERSION}"
|
||||
echo "Building ${LUXD_NODE_IMAGE} locally"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
source "${EVM_PATH}"/scripts/lib_luxd_clone.sh
|
||||
clone_luxd "${LUX_VERSION}"
|
||||
SKIP_BUILD_RACE=1 \
|
||||
|
||||
@@ -46,10 +46,14 @@ fi
|
||||
|
||||
IGNORED_CONDITIONS=()
|
||||
for file in ${IGNORED_FILES}; do
|
||||
if [[ -n "${IGNORED_CONDITIONS-}" ]]; then
|
||||
if [[ ${#IGNORED_CONDITIONS[@]} -gt 0 ]]; then
|
||||
IGNORED_CONDITIONS+=(-o)
|
||||
fi
|
||||
IGNORED_CONDITIONS+=(-path "${REPO_ROOT}/${file}" -prune)
|
||||
done
|
||||
|
||||
find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" "${@}"
|
||||
if [[ ${#IGNORED_CONDITIONS[@]} -gt 0 ]]; then
|
||||
find "${REPO_ROOT}" \( "${IGNORED_CONDITIONS[@]}" \) -o -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" -x "${@:+$@}"
|
||||
else
|
||||
find "${REPO_ROOT}" -type f -name "*.sh" -print0 | xargs -0 "${SHELLCHECK}" -x "${@:+$@}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user