Skip to content

Commit 725fbac

Browse files
committed
Mojo: Update onCreateCommand
1 parent b77ee78 commit 725fbac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.devcontainer/scripts/usr/local/bin/onCreateCommand.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ fi
5555
if [ "$(command -v mojo)" ]; then
5656
# Append the user's modular bin dir to PATH
5757
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
58+
(curl -ssL https://magic.modular.com || cat /var/tmp/magicenv.bak) \
59+
| grep '^MODULAR_HOME\|^BIN_DIR' | tee /tmp/magicenv > /dev/null
6060
. /tmp/magicenv
6161
mkdir -p "${BIN_DIR}"
6262
sed -i 's/\$HOME/\\$HOME/g' /tmp/magicenv
@@ -65,8 +65,8 @@ if [ "$(command -v mojo)" ]; then
6565
rm /tmp/magicenv
6666
fi
6767
if ! grep -q "user's modular bin dir" "$HOME/.zshrc"; then
68-
curl -ssL https://magic.modular.com | grep '^MODULAR_HOME\|^BIN_DIR' \
69-
> /tmp/magicenv
68+
(curl -ssL https://magic.modular.com || cat /var/tmp/magicenv.bak) \
69+
| grep '^MODULAR_HOME\|^BIN_DIR' | tee /tmp/magicenv > /dev/null
7070
. /tmp/magicenv
7171
mkdir -p "${BIN_DIR}"
7272
sed -i 's/\$HOME/\\$HOME/g' /tmp/magicenv

0 commit comments

Comments
 (0)