-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e58b3f
commit faf921f
Showing
5 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# @see http://editorconfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# md | ||
[*.md] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Main workflow | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- '**.md' | ||
- '.all-contributorsrc' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
- '.all-contributorsrc' | ||
schedule: | ||
- cron: '0 0 * * 5' | ||
|
||
jobs: | ||
plugin_test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: asdf_plugin_test | ||
uses: asdf-vm/actions/plugin-test@v1 | ||
with: | ||
command: 'which elixir-ls' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
# asdf-elixir-ls | ||
asdf plugin for elixir-ls | ||
|
||
[![GitHub Actions Status](https://github.com/juantascon/asdf-elixir-ls/actions/workflows/workflow.yml/badge.svg)](https://github.com/juantascon/asdf-elixir-ls/actions) | ||
[![GitHub license](https://img.shields.io/github/license/juantascon/asdf-elixir-ls?style=plastic)](https://github.com/juantascon/asdf-elixir-ls/blob/main/LICENSE) | ||
|
||
## Install | ||
|
||
```bash | ||
asdf plugin-add elixir https://github.com/juantascon/asdf-elixir-ls | ||
``` | ||
|
||
## Use | ||
|
||
Check out the [asdf](https://github.com/asdf-vm/asdf) readme for instructions on how to install and manage versions of elixir-ls. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
[[ -z ${ASDF_INSTALL_TYPE+x} ]] && echo "ASDF_INSTALL_TYPE is required" && exit 1 | ||
[[ -z ${ASDF_INSTALL_VERSION+x} ]] && echo "ASDF_INSTALL_VERSION is required" && exit 1 | ||
[[ -z ${ASDF_INSTALL_PATH+x} ]] && echo "ASDF_INSTALL_PATH is required" && exit 1 | ||
|
||
function install() { | ||
local install_type=$1 | ||
local version=$2 | ||
local install_path=$3 | ||
|
||
[ "$install_type" != "version" ] && echo "intall type, $install_type, is not supported" && exit 1 | ||
|
||
local tmp_download_dir=$(mktemp -d) | ||
local repo="elixir-lsp/elixir-ls" | ||
local download_filename="elixir-ls-v${version}.zip" | ||
local download_url="https://github.com/${repo}/releases/download/v${version}/${download_filename}" | ||
|
||
mkdir -p "${tmp_download_dir}" | ||
pushd "${tmp_download_dir}" >/dev/null | ||
|
||
echo "Downloading from ${download_url}" | ||
curl -fLsS -H "Accept: application/octet-stream" -o "${download_filename}" "${download_url}" | ||
|
||
mkdir -p unzip | ||
pushd unzip >/dev/null | ||
|
||
unzip "${tmp_download_dir}/${download_filename}" | ||
mkdir -p ./bin | ||
ln -s ../language_server.sh ./bin/elixir-ls | ||
ln -s ../debugger.sh ./bin/elixir-ls-debugger | ||
cp -fpr * "${install_path}" | ||
|
||
popd >/dev/null | ||
popd >/dev/null | ||
} | ||
|
||
install "${ASDF_INSTALL_TYPE}" "${ASDF_INSTALL_VERSION}" "${ASDF_INSTALL_PATH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
releases_path=https://api.github.com/repos/elixir-lsp/elixir-ls/releases | ||
cmd="curl -sL" | ||
if [ -n "$GITHUB_API_TOKEN" ]; then | ||
cmd="$cmd -H 'Authorization: token $GITHUB_API_TOKEN'" | ||
fi | ||
cmd="$cmd $releases_path" | ||
|
||
function sort_versions() { | ||
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | | ||
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}' | ||
} | ||
|
||
eval "$cmd" | grep -oE "tag_name\": \".{1,15}\"," | sed 's/tag_name\": \"v//;s/\",//' | sort_versions | xargs echo | ||
|