Skip to content

Commit 349dc57

Browse files
committed
Initialize rbenv in the shell
Add some logs and comments
1 parent 1f09227 commit 349dc57

File tree

1 file changed

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

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ else
1111
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
1212
fi
1313

14-
# Needs the - because it's being run in a script
15-
~/.rbenv/bin/rbenv init -
14+
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"` to the ~/.zshrc file
15+
echo 'Initializing rbenv'
16+
~/.rbenv/bin/rbenv init
1617

1718
if ! command -v zsh >/dev/null 2>&1; then
1819
echo "**** zsh not installed, skipping shell completions setup ****"
@@ -21,6 +22,7 @@ else
2122
if ! grep -q 'FPATH=~/.rbenv/completions:"$FPATH"' ~/.zshrc; then
2223
echo 'Adding shell completions to zsh for rbenv'
2324

25+
echo '\n# For rbenv shell completions' >> ~/.zshrc
2426
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
2527
echo 'autoload -U compinit' >> ~/.zshrc
2628
echo 'compinit' >> ~/.zshrc
@@ -30,6 +32,7 @@ else
3032
else
3133
echo '~/.zshrc not found, creating one with the shell completions'
3234

35+
echo '\n# For rbenv shell completions' >> ~/.zshrc
3336
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
3437
echo 'autoload -U compinit' >> ~/.zshrc
3538
echo 'compinit' >> ~/.zshrc

0 commit comments

Comments
 (0)