install.fairie/home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl
Brian Zalewski 3cb1ef26ff Update 2 files
- /home/.chezmoiscripts/universal/run_onchange_after_94-bash-it.tmpl
- /home/.chezmoiscripts/universal/run_onchange_after_95-bootstrap-zsh-plugins.tmpl
2023-03-27 07:03:32 +00:00

39 lines
1.3 KiB
Cheetah

{{- if (ne .host.distro.family "windows") -}}
#!/usr/bin/env -S bash -i
{{ 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 -}}