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

Make wrapper script more robust... more robustly #473

Merged
merged 2 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/elixir_ls_utils/priv/debugger.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/sh
# Launches the debugger. This script must be in the same directory as the compiled .ez archives.

readlink_f () {
cd "$(dirname "$1")" > /dev/null || exit 1
filename="$(basename "$1")"
if [ -h "$filename" ]; then
readlink_f "$(readlink "$filename")"
else
echo "$(pwd -P)/$filename"
fi
}

if [ -z "${ELS_INSTALL_PREFIX}" ]; then
dir=$(dirname "$0")
dir="$(dirname "$(readlink_f "$0")")"
else
dir=${ELS_INSTALL_PREFIX}
fi
Expand Down
12 changes: 11 additions & 1 deletion apps/elixir_ls_utils/priv/language_server.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/sh
# Launches the language server. This script must be in the same directory as the compiled .ez archives.

readlink_f () {
cd "$(dirname "$1")" > /dev/null || exit 1
filename="$(basename "$1")"
if [ -h "$filename" ]; then
readlink_f "$(readlink "$filename")"
else
echo "$(pwd -P)/$filename"
fi
}

if [ -z "${ELS_INSTALL_PREFIX}" ]; then
dir=$(dirname "$0")
dir="$(dirname "$(readlink_f "$0")")"
else
dir=${ELS_INSTALL_PREFIX}
fi
Expand Down
2 changes: 1 addition & 1 deletion apps/elixir_ls_utils/priv/launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
# include the local .ez files, and then do what we were asked to do.

readlink_f () {
cd "$(dirname "$1")" > /dev/null
cd "$(dirname "$1")" > /dev/null || exit 1
filename="$(basename "$1")"
if [ -h "$filename" ]; then
readlink_f "$(readlink "$filename")"
Expand Down