Skip to content

Commit 442e438

Browse files
committed
Use absolute paths in the install step
1 parent 4906b34 commit 442e438

File tree

1 file changed

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

1 file changed

+20
-20
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,54 @@
44
# so it can take advantage of packages installed
55
# init-mods-end depends on this script so that later init and services wait until this script exits
66

7-
if [ -d ~/.rbenv ]; then
7+
if [ -d /config/.rbenv ]; then
88
echo 'rbenv already cloned, skipping'
99
else
1010
echo 'Cloning rbenv repo'
11-
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
11+
git clone https://github.com/rbenv/rbenv.git /config/.rbenv
1212
fi
1313

14-
if [ -d ~/.rbenv/plugins/ruby-build ]; then
14+
if [ -d /config/.rbenv/plugins/ruby-build ]; then
1515
echo 'ruby-build plugin already cloned, skipping'
1616

1717
echo 'Upgrading ruby-build plugin'
18-
git -C ~/.rbenv/plugins/ruby-build pull
18+
git -C /config/.rbenv/plugins/ruby-build pull
1919
else
2020
echo 'Cloning ruby-build plugin repo'
21-
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
21+
git clone https://github.com/rbenv/ruby-build.git /config/.rbenv/plugins/ruby-build
2222
fi
2323

2424
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash bash)"` to the ~/.bashrc or ~/.bash_profile file
2525
echo 'Initializing rbenv for bash'
26-
~/.rbenv/bin/rbenv init
26+
/config/.rbenv/bin/rbenv init
2727

2828
if ! command -v zsh >/dev/null 2>&1; then
2929
echo "**** zsh not installed, skipping shell completions setup ****"
3030
else
3131
# This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"` to the ~/.zshrc file
3232
echo 'Initializing rbenv for zsh'
33-
~/.rbenv/bin/rbenv init zsh
33+
/config/.rbenv/bin/rbenv init zsh
3434

35-
if [ -f ~/.zshrc ]; then
36-
if ! grep -q 'FPATH=~/.rbenv/completions:"$FPATH"' ~/.zshrc; then
35+
if [ -f /config/.zshrc ]; then
36+
if ! grep -q 'FPATH=~/.rbenv/completions:"$FPATH"' /config/.zshrc; then
3737
echo 'Adding shell completions to zsh for rbenv'
3838

39-
echo '' >> ~/.zshrc
40-
echo '# For rbenv shell completions' >> ~/.zshrc
41-
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
42-
echo 'autoload -U compinit' >> ~/.zshrc
43-
echo 'compinit' >> ~/.zshrc
39+
echo '' >> /config/.zshrc
40+
echo '# For rbenv shell completions' >> /config/.zshrc
41+
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> /config/.zshrc
42+
echo 'autoload -U compinit' >> /config/.zshrc
43+
echo 'compinit' >> /config/.zshrc
4444
else
4545
echo 'rbenv shell completions already exist in zsh, skipping'
4646
fi
4747
else
48-
echo '~/.zshrc not found, creating one with the shell completions'
48+
echo '/config/.zshrc not found, creating one with the shell completions'
4949

50-
echo '' >> ~/.zshrc
51-
echo '# For rbenv shell completions' >> ~/.zshrc
52-
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> ~/.zshrc
53-
echo 'autoload -U compinit' >> ~/.zshrc
54-
echo 'compinit' >> ~/.zshrc
50+
echo '' >> /config/.zshrc
51+
echo '# For rbenv shell completions' >> /config/.zshrc
52+
echo 'FPATH=~/.rbenv/completions:"$FPATH"' >> /config/.zshrc
53+
echo 'autoload -U compinit' >> /config/.zshrc
54+
echo 'compinit' >> /config/.zshrc
5555
fi
5656
fi
5757

0 commit comments

Comments
 (0)