From beefd1dc5781922f2c5976230c81dd037863f1af Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Mon, 3 Jun 2024 01:33:39 +0200 Subject: [PATCH] Update initialization logic --- bash/bashrc.d/init.d/path.sh | 3 +++ bash/bashrc.d/startup.sh | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) create mode 100755 bash/bashrc.d/init.d/path.sh diff --git a/bash/bashrc.d/init.d/path.sh b/bash/bashrc.d/init.d/path.sh new file mode 100755 index 00000000..74d20f1d --- /dev/null +++ b/bash/bashrc.d/init.d/path.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +export "PATH=${PATH}:${HOME}/.local/bin:${HOME}/.local/share/flatpak/exports/bin:${HOME}/.cargo/bin" diff --git a/bash/bashrc.d/startup.sh b/bash/bashrc.d/startup.sh index 0a383056..dcaf8484 100755 --- a/bash/bashrc.d/startup.sh +++ b/bash/bashrc.d/startup.sh @@ -6,8 +6,14 @@ cd "${HOME:?}/.bashrc.d" || ( exit 1 ) +# Initialize basic stuff +[[ -f "init.d/path.sh" ]] && source "init.d/path.sh" +[[ -f "init.d/variables.sh" ]] && source "init.d/variables.sh" +[[ -f "init.d/aliases.sh" ]] && source "init.d/aliases.sh" +[[ -f "init.d/functions.sh" ]] && source "init.d/functions.sh" + # Create new configuration file -[[ ! -f "config.sh" ]] && cat << EOF >> config.sh +[[ ! -f "config.sh" ]] && $(which cat) << EOF >> config.sh #!/usr/bin/env bash CONFIG_FLOW_CONTROL=0 CONFIG_AUTOSAVE_HISTORY=1 @@ -20,11 +26,6 @@ EOF # Load configuration file source "config.sh" -# Initialize basic stuff -[[ -f "init.d/variables.sh" ]] && source "init.d/variables.sh" -[[ -f "init.d/aliases.sh" ]] && source "init.d/aliases.sh" -[[ -f "init.d/functions.sh" ]] && source "init.d/functions.sh" - # Process configuration changes # -> Flow control [[ "${CONFIG_FLOW_CONTROl}" == "0" ]] && stty -ixon