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

Partial change to show better versioning #121

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ erl_crash.dump
/release

# Also ignore temp files created during testing
**/test/tmp
**/test/tmp

elixir-ls-dist.tar
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Simple makefile for distribution and installation
#
INSTALL_DIR ?= ${HOME}/.local/share/elixir-ls

.PHONY: dist install

dist:
tar cvf elixir-ls-dist.tar config apps mix.exs

install: dist
mkdir -p ${INSTALL_DIR}
tar xvCf ${INSTALL_DIR} elixir-ls-dist.tar
cp ${INSTALL_DIR}/apps/elixir_ls_utils/priv/* ${INSTALL_DIR}
17 changes: 13 additions & 4 deletions apps/elixir_ls_utils/priv/language_server.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Launches the language server. This script must be in the same directory as the compiled .ez archives.

[ -f "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh"

Expand All @@ -13,8 +12,18 @@ readlink_f () {
fi
}

SCRIPT=$(readlink_f $0)
SCRIPTPATH=`dirname $SCRIPT`
export ERL_LIBS="$SCRIPTPATH:$ERL_LIBS"
version=$(elixir -v|grep ^Elixir| sed 's/Elixir \(.*\) (compiled with Erlang\/OTP \(.*\))/\1-\2/')

target_dir=~/.cache/elixir-ls/$version

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to respect XDG dirs here?

Suggested change
target_dir=~/.cache/elixir-ls/$version
target_dir="${XDG_CACHE_HOME:-~/.cache}/elixir-ls/$version"


if [ ! -d $target_dir ]; then
mkdir -p $target_dir
cp -r . $target_dir
cd $target_dir
mix do deps.get, compile, elixir_ls.release -o .
rm -rf apps config deps _build mix.* *.sh *.bat
fi

export ERL_LIBS="$target_dir:$ERL_LIBS"

elixir -e "ElixirLS.LanguageServer.CLI.main()"