refactor: remove bootstrap spaghetti from installers
This commit is contained in:
@@ -84,3 +84,9 @@ version_lt() {
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Export functions and variables for subshells
|
||||
export _LIB_COMMON_SOURCED=1
|
||||
export RED GREEN YELLOW BLUE NC
|
||||
export -f require_bash log_info log_success log_warn log_error confirm has_command make_temp_dir version_lt
|
||||
|
||||
|
||||
@@ -88,3 +88,8 @@ pkg_install() {
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Export functions and variables for subshells
|
||||
export _LIB_PLATFORM_SOURCED=1
|
||||
export -f detect_distro detect_arch pkg_install
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ BOOTSTRAP_DIR="${BOOTSTRAP_DIR:-$(dirname "$_LIB_DIR")}"
|
||||
if [ ! -d "$BOOTSTRAP_DIR/lib" ]; then
|
||||
BOOTSTRAP_DIR="$HOME/.config/bootstrap"
|
||||
fi
|
||||
export BOOTSTRAP_DIR
|
||||
|
||||
# Source common library
|
||||
if [ -f "$BOOTSTRAP_DIR/lib/common.sh" ]; then
|
||||
@@ -54,6 +55,13 @@ run_ware() {
|
||||
|
||||
# Check for local installer first
|
||||
local local_installer="$BOOTSTRAP_DIR/installers/install_${tool}.sh"
|
||||
|
||||
if [ "$bypass_edit" = "true" ] && [ -f "$local_installer" ]; then
|
||||
log_info "Running ${display_name} installer..."
|
||||
bash "$local_installer" "${cmd_args[@]}"
|
||||
return $?
|
||||
fi
|
||||
|
||||
local temp_script
|
||||
temp_script=$(mktemp --suffix=".sh" 2>/dev/null || mktemp)
|
||||
|
||||
|
||||
@@ -109,3 +109,8 @@ create_fd_symlink() {
|
||||
sudo ln -sf "$(command -v fdfind)" /usr/local/bin/fd
|
||||
fi
|
||||
}
|
||||
|
||||
# Export functions and variables for subshells
|
||||
export _LIB_SHELL_CONFIG_SOURCED=1
|
||||
export -f get_shell_configs remove_block inject_block add_alias_if_missing add_env_if_missing create_fd_symlink
|
||||
|
||||
|
||||
Reference in New Issue
Block a user