lexical-lsp / lexical

Lexical is a next-generation elixir language server
782 stars 77 forks source link

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

Closed JonasGruenwald closed 4 months ago

JonasGruenwald commented 4 months ago

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

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.