dotfiles script v0.4.2
- change bash completion from single file to per-directory (~/.bash_completion.d/)
This commit is contained in:
parent
1764e39cb8
commit
9b2fa59ed8
3 changed files with 32 additions and 10 deletions
28
bin/dotfiles
28
bin/dotfiles
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
##
|
||||
## binaryDiv's dotfiles management script
|
||||
## Version 0.4.1
|
||||
## Version 0.4.2
|
||||
##
|
||||
|
||||
usage() {
|
||||
|
|
@ -74,11 +74,27 @@ case "$cmd" in
|
|||
echo "! Warning: $bin_dir is not in your PATH."
|
||||
fi
|
||||
|
||||
# Activate bash completion
|
||||
if [[ ! -e "$homedir/.bash_completion" ]]; then
|
||||
echo "* Installing user-defined bash completion"
|
||||
"$0" link -q .bash_completion &&
|
||||
echo " Restart bash or run 'source $homedir/.bash_completion' to activate it now"
|
||||
show_bash_restart_info=
|
||||
|
||||
# Enable user-defined bash completion per directory
|
||||
bashcompletion_filename=.bash_completion
|
||||
if [[ ! -e "$homedir/$bashcompletion_filename" ]]; then
|
||||
echo "* Installing user-defined bash completion (~/.bash_completion.d/)"
|
||||
"$0" link -q "$bashcompletion_filename" &&
|
||||
show_bash_restart_info=1
|
||||
fi
|
||||
mkdir -p "$homedir/.bash_completion.d"
|
||||
|
||||
# Activate dotfiles bash completion
|
||||
bashcompletion_dotfiles_filename=.bash_completion.d/10-dotfiles.sh
|
||||
if [[ ! -e "$homedir/$bashcompletion_dotfiles_filename" ]]; then
|
||||
echo "* Installing bash completion for dotfiles script"
|
||||
"$0" link -q "$bashcompletion_dotfiles_filename" &&
|
||||
show_bash_restart_info=1
|
||||
fi
|
||||
|
||||
if [[ -n $show_bash_restart_info ]]; then
|
||||
echo " Restart bash or run 'source $homedir/.bash_completion' to activate it now"
|
||||
fi
|
||||
|
||||
echo "* Configuring git settings"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue