use absolute paths instead of changing directory
parent
293d86771a
commit
8fcf713541
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
BASH_IT_LOG_PREFIX="core: reloader: "
|
||||
pushd "${BASH_IT}" >/dev/null || exit 1
|
||||
|
||||
function _set-prefix-based-on-path()
|
||||
{
|
||||
|
|
@ -9,7 +8,7 @@ function _set-prefix-based-on-path()
|
|||
BASH_IT_LOG_PREFIX="$extension: $filename: "
|
||||
}
|
||||
|
||||
if [ "$1" != "skip" ] && [ -d "./enabled" ]; then
|
||||
if [[ "$1" != "skip" ]] && [[ -d "$BASH_IT/enabled" ]]; then
|
||||
_bash_it_config_type=""
|
||||
|
||||
case $1 in
|
||||
|
|
@ -20,7 +19,7 @@ if [ "$1" != "skip" ] && [ -d "./enabled" ]; then
|
|||
_log_debug "Loading all enabled components..." ;;
|
||||
esac
|
||||
|
||||
for _bash_it_config_file in $(sort <(compgen -G "./enabled/*${_bash_it_config_type}.bash")); do
|
||||
for _bash_it_config_file in $(sort <(compgen -G "$BASH_IT/enabled/*${_bash_it_config_type}.bash")); do
|
||||
if [ -e "${_bash_it_config_file}" ]; then
|
||||
_set-prefix-based-on-path "${_bash_it_config_file}"
|
||||
_log_debug "Loading component..."
|
||||
|
|
@ -32,12 +31,12 @@ if [ "$1" != "skip" ] && [ -d "./enabled" ]; then
|
|||
done
|
||||
fi
|
||||
|
||||
if [ -n "${2}" ] && [ -d "${2}/enabled" ]; then
|
||||
if [[ -n "${2}" ]] && [[ -d "$BASH_IT/${2}/enabled" ]]; then
|
||||
case $2 in
|
||||
aliases|completion|plugins)
|
||||
_log_warning "Using legacy enabling for $2, please update your bash-it version and migrate"
|
||||
for _bash_it_config_file in $(sort <(compgen -G "./${2}/enabled/*.bash")); do
|
||||
if [ -e "$_bash_it_config_file" ]; then
|
||||
for _bash_it_config_file in $(sort <(compgen -G "$BASH_IT/${2}/enabled/*.bash")); do
|
||||
if [[ -e "$_bash_it_config_file" ]]; then
|
||||
_set-prefix-based-on-path "${_bash_it_config_file}"
|
||||
_log_debug "Loading component..."
|
||||
# shellcheck source=/dev/null
|
||||
|
|
@ -51,4 +50,3 @@ fi
|
|||
|
||||
unset _bash_it_config_file
|
||||
unset _bash_it_config_type
|
||||
popd >/dev/null || exit 1
|
||||
|
|
|
|||
Loading…
Reference in New Issue