|
4 | 4 | # so it can take advantage of packages installed |
5 | 5 | # init-mods-end depends on this script so that later init and services wait until this script exits |
6 | 6 |
|
7 | | -if [ -d ~/.rbenv ]; then |
| 7 | +if [ -d /config/.rbenv ]; then |
8 | 8 | echo 'rbenv already cloned, skipping' |
9 | 9 | else |
10 | 10 | 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 |
12 | 12 | fi |
13 | 13 |
|
14 | | -if [ -d ~/.rbenv/plugins/ruby-build ]; then |
| 14 | +if [ -d /config/.rbenv/plugins/ruby-build ]; then |
15 | 15 | echo 'ruby-build plugin already cloned, skipping' |
16 | 16 |
|
17 | 17 | echo 'Upgrading ruby-build plugin' |
18 | | - git -C ~/.rbenv/plugins/ruby-build pull |
| 18 | + git -C /config/.rbenv/plugins/ruby-build pull |
19 | 19 | else |
20 | 20 | 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 |
22 | 22 | fi |
23 | 23 |
|
24 | 24 | # This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash bash)"` to the ~/.bashrc or ~/.bash_profile file |
25 | 25 | echo 'Initializing rbenv for bash' |
26 | | -~/.rbenv/bin/rbenv init |
| 26 | +/config/.rbenv/bin/rbenv init |
27 | 27 |
|
28 | 28 | if ! command -v zsh >/dev/null 2>&1; then |
29 | 29 | echo "**** zsh not installed, skipping shell completions setup ****" |
30 | 30 | else |
31 | 31 | # This will add `eval "$(~/.rbenv/bin/rbenv init - --no-rehash zsh)"` to the ~/.zshrc file |
32 | 32 | echo 'Initializing rbenv for zsh' |
33 | | - ~/.rbenv/bin/rbenv init zsh |
| 33 | + /config/.rbenv/bin/rbenv init zsh |
34 | 34 |
|
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 |
37 | 37 | echo 'Adding shell completions to zsh for rbenv' |
38 | 38 |
|
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 |
44 | 44 | else |
45 | 45 | echo 'rbenv shell completions already exist in zsh, skipping' |
46 | 46 | fi |
47 | 47 | else |
48 | | - echo '~/.zshrc not found, creating one with the shell completions' |
| 48 | + echo '/config/.zshrc not found, creating one with the shell completions' |
49 | 49 |
|
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 |
55 | 55 | fi |
56 | 56 | fi |
57 | 57 |
|
|
0 commit comments