Skip to content

Commit 23d6221

Browse files
committed
Fix rbenv init command
Make sure to run it for zsh too when we detect that zsh is installed
1 parent 349dc57 commit 23d6221

File tree

1 file changed

+10
-4
lines changed
  • root/etc/s6-overlay/s6-rc.d/init-mod-code-server-rbenv-install

1 file changed

+10
-4
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-code-server-rbenv-install/run

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,23 @@ else
1111
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
1212
fi
1313

14-
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"` to the ~/.zshrc file
15-
echo 'Initializing rbenv'
14+
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash bash)"` to the ~/.bashrc or ~/.bash_profile file
15+
echo 'Initializing rbenv for bash'
1616
~/.rbenv/bin/rbenv init
1717

1818
if ! command -v zsh >/dev/null 2>&1; then
1919
echo "**** zsh not installed, skipping shell completions setup ****"
2020
else
21+
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"` to the ~/.zshrc file
22+
echo 'Initializing rbenv for zsh'
23+
~/.rbenv/bin/rbenv init zsh
24+
2125
if [ -f ~/.zshrc ]; then
2226
if ! grep -q 'FPATH=~/.rbenv/completions:"$FPATH"' ~/.zshrc; then
2327
echo 'Adding shell completions to zsh for rbenv'
2428

25-
echo '\n# For rbenv shell completions' >> ~/.zshrc
29+
echo '' >> ~/.zshrc
30+
echo '# For rbenv shell completions' >> ~/.zshrc
2631
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
2732
echo 'autoload -U compinit' >> ~/.zshrc
2833
echo 'compinit' >> ~/.zshrc
@@ -32,7 +37,8 @@ else
3237
else
3338
echo '~/.zshrc not found, creating one with the shell completions'
3439

35-
echo '\n# For rbenv shell completions' >> ~/.zshrc
40+
echo '' >> ~/.zshrc
41+
echo '# For rbenv shell completions' >> ~/.zshrc
3642
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
3743
echo 'autoload -U compinit' >> ~/.zshrc
3844
echo 'compinit' >> ~/.zshrc

0 commit comments

Comments
 (0)