Skip to content

Commit

Permalink
fix(alpine): set vim-shell to 'sh' if 'bash' isn't in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Sep 13, 2024
1 parent b58d6ad commit 258175e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vim-shell/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ __init_vim_shell() {
touch "$HOME/.vimrc"
fi

if ! grep 'shell=' -r ~/.vimrc > /dev/null 2> /dev/null; then
if ! grep -q 'shell=' ~/.vimrc 2> /dev/null; then
b_shell='bash'
if ! command -v bash > /dev/null; then
b_shell='sh'
fi
{
printf '" bash set as default shell (for compatibility) by webinstall.dev/vim-shell\n'
printf 'set shell=bash\n'
printf 'set shell=%s\n' "${b_shell}"
printf '\n'
cat ~/.vimrc
} >> ~/.vimrc.new.1
Expand Down

0 comments on commit 258175e

Please sign in to comment.