fix HOST specific directory for bash

This commit is contained in:
thek4n 2023-12-06 14:44:16 +03:00
parent 0f61afbcfc
commit b936c92e34
3 changed files with 8 additions and 10 deletions

View File

@ -1,8 +1,8 @@
_sod() {
if [ -d "$1" ] && [ -n "$(ls "$1"/ 2>/dev/null)" ]; then
for FILENAME in $(ls "$1"/ | sort -n)
if [ -d "$1" ] && [ -n "$(ls "$1")" ]; then
for FILENAME in $(ls "$1" | sort -n)
do
source "$1"/"$FILENAME"
source "$1/$FILENAME"
done
fi
}

View File

@ -1,6 +1,5 @@
_so () {
[ -r "$1" ] && source "$1"
_so() {
[ -r "$1" ] && [ -f "$1" ] && source "$1"
}
if [[ $0 == *bash ]]; then
@ -13,7 +12,7 @@ if [[ $- == *i* ]]; then
_so "$HOME/.config/bash/aliases"
_so "$HOME/.config/bash/functions"
_so "$HOME/.config/bash/completion"
_so "$HOME/.config/bash/hosts/$HOST"
_so "$HOME/.config/bash/hosts/$HOSTNAME"
fi

View File

@ -1,6 +1,5 @@
_so () {
[ -f "$1" ] && source "$1"
_so() {
[ -r "$1" ] && [ -f "$1" ] && source "$1"
}
_so /etc/zsh_command_not_found