modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
23.22k stars 2.6k forks source link

[Modular CLI]: make installation-Shell-Script compatible to the POSIX standard and do not use [[ in the script - or adapt instructions to use bash #1647

Closed elasticjava closed 2 weeks ago

elasticjava commented 9 months ago

Issue description

in line 80 of the installation script got by curl https://get.modular.com you use following code:

if [[ -n "${MODULAR_AUTH-}" ]]; then
  modular auth "$MODULAR_AUTH"
fi

this is valid for bash shell scripting but not for shell scripting compatible to the POSIX standard. you have to write:

if [ -n "${MODULAR_AUTH-}" ]; then
  modular auth "$MODULAR_AUTH"
fi

Steps to reproduce

follow the instruction No.2 on https://developer.modular.com/download

Version Info

modular (0.3.1)
vctrstrm commented 8 months ago

Just ran into this. This is actually not even a standard issue but a complete breaking bug. All current instructions say to run script through "/bin/sh" (including Windows WSL instructions), even the shebang line at top of the script from get.modular.com is "#!/bin/sh". The syntax used at line 80 of that script (referenced in OP) is simply not compatible with /bin/sh and breaks during install so nothing there ever runs anyway.

I believe the script is being tested against BASH instead of SH (the intended runtime)

ematejska commented 2 weeks ago

Thank you for trying out Mojo. The installation experience has significantly changed and we're closing out all the old issues with the old installer. To try out our new installation experience using "magic", please see: https://docs.modular.com/mojo/manual/get-started.