From 33c85f56fc7ed0293ee7036750bf21f433a0e8d8 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Sat, 28 Mar 2026 17:02:27 +0300 Subject: [PATCH] install bash completions to ~/.local/share/bash-completion/completions --- install_bash_completions.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install_bash_completions.sh b/install_bash_completions.sh index ea619fc..08b34ff 100755 --- a/install_bash_completions.sh +++ b/install_bash_completions.sh @@ -2,21 +2,25 @@ # complete_alias is a script that allows to use completion in aliases declare -A bashCompletions=( - ["complete_alias"]="https://raw.githubusercontent.com/cykerway/complete-alias/master/complete_alias" ["tmux"]="https://raw.githubusercontent.com/Bash-it/bash-it/master/completion/available/tmux.completion.bash" ["git"]="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash" ) -bashCompletionsDir="$HOME/.config/bash-completions" +bashCompletionsDir="$HOME/.local/share/bash-completion/completions" __install_bash_completions() { + if [[ ! -d "$HOME/.config/bash-completions" ]]; then + mkdir -p $HOME/.config/bash-completions + fi + curl "https://raw.githubusercontent.com/cykerway/complete-alias/master/complete_alias" -o $HOME/.config/bash-completions/complete_alias + if [[ ! -d "$bashCompletionsDir" ]]; then mkdir "$bashCompletionsDir" fi for cmp in "${!bashCompletions[@]}"; do source=${bashCompletions[$cmp]} - dest="$bashCompletionsDir/$cmp.bash" + dest="$bashCompletionsDir/$cmp" if [[ ! -f "$dest" ]]; then echo "Downloading $cmp completion"