|
52 | 52 | fi
|
53 | 53 | fi
|
54 | 54 |
|
55 |
| -if ! grep -q "user's private bin" "$HOME/.bashrc"; then |
56 |
| - # If existent, prepend the user's private bin to PATH |
57 |
| - cat "/var/tmp/snippets/rc.sh" >> "$HOME/.bashrc" |
58 |
| -fi |
59 |
| -if ! grep -q "user's private bin" "$HOME/.zshrc"; then |
60 |
| - if [ "$(command -v mojo)" ]; then |
61 |
| - # Append the magic bin dir to PATH |
| 55 | +if [ "$(command -v mojo)" ]; then |
| 56 | + # Append the user's modular bin dir to PATH |
| 57 | + if ! grep -q "user's modular bin dir" "$HOME/.bashrc"; then |
| 58 | + curl -ssL https://magic.modular.com | grep '^MODULAR_HOME\|^BIN_DIR' \ |
| 59 | + > /tmp/magicenv |
| 60 | + sed -i 's/\$HOME/\\$HOME/g' /tmp/magicenv |
| 61 | + . /tmp/magicenv |
| 62 | + echo -e "\n# Append the user's modular bin dir to PATH\nif [[ \"\$PATH\" != *\"${BIN_DIR}\"* ]] ; then\n PATH=\"\$PATH:${BIN_DIR}\"\nfi" >> "$HOME/.bashrc" |
| 63 | + rm /tmp/magicenv |
| 64 | + fi |
| 65 | + if ! grep -q "user's modular bin dir" "$HOME/.zshrc"; then |
62 | 66 | curl -ssL https://magic.modular.com | grep '^MODULAR_HOME\|^BIN_DIR' \
|
63 | 67 | > /tmp/magicenv
|
64 | 68 | sed -i 's/\$HOME/\\$HOME/g' /tmp/magicenv
|
65 | 69 | . /tmp/magicenv
|
66 |
| - echo -e "\nif [[ \"\$PATH\" != *\"${BIN_DIR}\"* ]] ; then\n PATH=\"\$PATH:${BIN_DIR}\"\nfi" >> "$HOME/.zshrc" |
| 70 | + echo -e "\n# Append the user's modular bin dir to PATH\nif [[ \"\$PATH\" != *\"${BIN_DIR}\"* ]] ; then\n PATH=\"\$PATH:${BIN_DIR}\"\nfi" >> "$HOME/.zshrc" |
67 | 71 | rm /tmp/magicenv
|
68 | 72 | fi
|
69 |
| - # If existent, prepend the user's private bin to PATH |
| 73 | +fi |
| 74 | + |
| 75 | +# If existent, prepend the user's private bin to PATH |
| 76 | +if ! grep -q "user's private bin" "$HOME/.bashrc"; then |
| 77 | + cat "/var/tmp/snippets/rc.sh" >> "$HOME/.bashrc" |
| 78 | +fi |
| 79 | +if ! grep -q "user's private bin" "$HOME/.zshrc"; then |
70 | 80 | cat "/var/tmp/snippets/rc.sh" >> "$HOME/.zshrc"
|
71 | 81 | fi
|
72 | 82 |
|
|
0 commit comments