Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

start_lexical.sh exiting early when no version manager is installed #615

Closed
JonasGruenwald opened this issue Feb 22, 2024 · 0 comments · Fixed by #616
Closed

start_lexical.sh exiting early when no version manager is installed #615

JonasGruenwald opened this issue Feb 22, 2024 · 0 comments · Fixed by #616

Comments

@JonasGruenwald
Copy link

I'm using the vscode extension, and I have verified that it has installed the latest version of lexical ("0.5.0").

The vscode extension fails to start up since it's trying to run start_lexical.sh which exits with exit code 1.
I have looked into start_lexical.sh and activate_version_manager.sh and I have found that

  • Since I have none of these version managers installed (I installed Elixir via homebrew) it goes through the whole activate_version_manager.sh, printing "No activated version manager detected. Searching for version manager..." and exits with exit code 1 at the end after trying mise
  • At this point, I believe start_lexical.sh should print "Could not activate a version manager. Trying system installation." and continue to start lexical, but instead the script just exits with code 1 without printing anything.

From what I can tell this is happening because of set -e at the start of start_lexical.sh, if I change the second line to just set -o pipefail instead of set -eo pipefail the script works as expected for me.

I have to say I'm not sure why because from what I understand set -e shouldn't cause an exit if the non-zero exiting command is called in an if-statement, which it is, but it does happen 🤷
For context I am on MacOS and my bash version is

GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin23)
Copyright (C) 2007 Free Software Foundation, Inc.
scohen added a commit that referenced this issue Feb 22, 2024
The -e option exits immediately on an error, which will cause the
command to exit if no version manager is detected. This means we won't
try to invoke elixir from the path.

From my limited knowledge of bash, it looks like this command was
added in error.

Fixes #615
scohen added a commit that referenced this issue Feb 22, 2024
The -e option exits immediately on an error, which will cause the
command to exit if no version manager is detected. This means we won't
try to invoke elixir from the path.

From my limited knowledge of bash, it looks like this command was
added in error.

Fixes #615
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant