scripts: reloader: Improve shellcheck directives

pull/1761/head
Noah Gorny 2021-01-29 17:12:29 +02:00
parent afde183e5a
commit 16fcb79769
1 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,4 @@
# shellcheck shell=bash # shellcheck shell=bash
# shellcheck disable=SC1090,SC2221,SC2222,SC2145,SC2064
BASH_IT_LOG_PREFIX="core: reloader: " BASH_IT_LOG_PREFIX="core: reloader: "
pushd "${BASH_IT}" > /dev/null || exit 1 pushd "${BASH_IT}" > /dev/null || exit 1
@ -24,12 +23,13 @@ _bash-it-load-sources() {
_log_debug "Loading component..." _log_debug "Loading component..."
output=$( output=$(
set -e set -e
# shellcheck disable=SC1090
(source "$current") 2>&1 (source "$current") 2>&1
) )
retval=$? retval=$?
set +e set +e
trap "_bash-it-load-sources ${scripts[@]}" EXIT trap '_bash-it-load-sources ${scripts[@]}' EXIT
if [[ $retval -gt 0 ]]; then if [[ $retval -gt 0 ]]; then
_log_error 'Loading component failed...' _log_error 'Loading component failed...'
if [[ -n "$output" ]]; then if [[ -n "$output" ]]; then
@ -37,6 +37,7 @@ _bash-it-load-sources() {
fi fi
else else
_log_debug 'Loading component successful!' _log_debug 'Loading component successful!'
# shellcheck disable=SC1090
source "$current" source "$current"
fi fi
trap - EXIT trap - EXIT
@ -51,6 +52,7 @@ _bash-it-load-sources() {
if [[ "$1" != "skip" ]] && [[ -d "./enabled" ]]; then if [[ "$1" != "skip" ]] && [[ -d "./enabled" ]]; then
_bash_it_config_type="" _bash_it_config_type=""
# shellcheck disable=SC2221,SC2222
case $1 in case $1 in
alias | completion | plugin) alias | completion | plugin)
_bash_it_config_type=$1 _bash_it_config_type=$1