bash: Fix loading bash specific profile and env files
This commit is contained in:
parent
e25ce19719
commit
4bff036d1d
3 changed files with 29 additions and 8 deletions
|
@ -10,19 +10,33 @@ export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"}
|
||||||
# load global sh env vars
|
# load global sh env vars
|
||||||
[ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env"
|
[ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env"
|
||||||
if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then
|
if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then
|
||||||
for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do
|
for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do
|
||||||
. "$_env"
|
. "$_env"
|
||||||
done
|
done
|
||||||
unset _env
|
unset _env
|
||||||
|
fi
|
||||||
|
[ -f "$XDG_CONFIG_HOME/bash/env" ] && source "$XDG_CONFIG_HOME/bash/env"
|
||||||
|
if [ -d "$XDG_CONFIG_HOME/bash/env.d" ]; then
|
||||||
|
for _env in "$XDG_CONFIG_HOME/bash/env.d"/*.sh; do
|
||||||
|
. "$_env"
|
||||||
|
done
|
||||||
|
unset _env
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# load profile files vars
|
# load profile files vars
|
||||||
[ -f "$XDG_CONFIG_HOME/sh/profile" ] && source "$XDG_CONFIG_HOME/sh/profile"
|
[ -f "$XDG_CONFIG_HOME/sh/profile" ] && source "$XDG_CONFIG_HOME/sh/profile"
|
||||||
if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then
|
if [ -d "$XDG_CONFIG_HOME/sh/profile.d" ]; then
|
||||||
for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do
|
for _profile in "$XDG_CONFIG_HOME/sh/profile.d"/*.sh; do
|
||||||
. "$_profile"
|
. "$_profile"
|
||||||
done
|
done
|
||||||
unset _profile
|
unset _profile
|
||||||
|
fi
|
||||||
|
[ -f "$XDG_CONFIG_HOME/bash/profile" ] && source "$XDG_CONFIG_HOME/bash/profile"
|
||||||
|
if [ -d "$XDG_CONFIG_HOME/bash/profile.d" ]; then
|
||||||
|
for _profile in "$XDG_CONFIG_HOME/bash/profile.d"/*.sh; do
|
||||||
|
. "$_profile"
|
||||||
|
done
|
||||||
|
unset _profile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# ~/.bashrc
|
# ~/.bashrc
|
||||||
#
|
#
|
||||||
|
|
6
bash/.config/bash/env.d/bash-history-xdg.sh
Normal file
6
bash/.config/bash/env.d/bash-history-xdg.sh
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export HISTFILE="${XDG_STATE_HOME}/bash/history"
|
||||||
|
|
||||||
|
# bashrc, bash_profile, bash_logout currently unsupported
|
||||||
|
# see https://savannah.gnu.org/support/?108134
|
Loading…
Reference in a new issue