install.fairie/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.sh.tmpl

45 lines
1.6 KiB
Cheetah
Raw Normal View History

{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env -S bash -i
Update 21 files - /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_85-remove-shortcuts.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_98-cleanup.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_after_99-restart-gnome.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_08-install-zx.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_09-install-go.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_09-node-version.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_10-remove-bloatware.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_11-install-docker.sh.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_91-configure-gpg.sh.tmpl
2023-04-11 20:57:02 -07:00
# @file Bash It!
# @brief Ensures Bash is configured to use Bash It!
# @description
# This script ensures Bash is configured to use Bash It! It ensures dependencies are installed, installs completions,
# and enables Bash It! plugins. The completions and plugins are hardcoded in this script.
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
### Ensure Powerline is installed
if ! command -v powerline > /dev/null; then
install-software powerline
fi
### Bash-it completions / plugins
if command -v powerline > /dev/null && [ -f "$HOME/.bashrc" ]; then
logg info 'Running `source ~/.bashrc`'
source ~/.bashrc
logg success 'Imported the `~/.bashrc` profile'
if command -v bash-it > /dev/null; then
if [ -n "$BASH_IT" ]; then
cd "$BASH_IT" || logg warn "The $BASH_IT directory does not exist"
logg info 'Enabling bash-it completions'
yes | bash-it enable completion defaults dirs docker docker-compose export git makefile ng npm ssh system vagrant
logg info 'Enabling bash-it plugins'
yes | bash-it enable plugin base blesh browser cht-sh dirs gitstatus powerline sudo xterm
logg info 'Finished enabling bash-it functions'
else
logg warn 'The BASH_IT variable needs to be defined'
fi
else
logg warn '`bash-it` is not available'
fi
else
if ! command -v powerline > /dev/null; then
logg warn '`powerline` is not available'
else
logg warn '`~/.bashrc` is missing'
fi
fi
{{ end -}}