Skip to content

Commit

Permalink
Added homebrew bash completions
Browse files Browse the repository at this point in the history
Added function to check if a directory has files
  • Loading branch information
missingcharacter committed Jul 11, 2024
1 parent b33f354 commit 27997a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Ubuntu/bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ fi
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

for file in "$(brew --prefix)"/etc/bash_completion.d/*; do
. "${file}"
done

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
Expand Down
9 changes: 9 additions & 0 deletions bash_aliases
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,15 @@ function base64decodestring() {
"${base64_cmds[@]}" <<<"${TEXT}"
}

function has_files() {
local directory="${1}"
retval=1
if [ -n "$(ls -A "${directory}" 2>/dev/null)" ]; then
retval=0
fi
return "${retval}"
}

# Sourcing Operating System Specific bash_aliases
if [ -f ~/.bash_os_aliases ]; then
# shellcheck source=/dev/null
Expand Down

0 comments on commit 27997a7

Please sign in to comment.