Skip to content

Commit

Permalink
lang: compute tag before fetching cli
Browse files Browse the repository at this point in the history
  • Loading branch information
stackmystack committed May 29, 2024
1 parent 5e5fbc6 commit 9d2e7da
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lang
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ root=$(realpath "$PWD")

# Get tree-sitter-cli

tstag=${TREE_SITTER_VERSION:-$(\
git \
-c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' \
--tags https://github.com/tree-sitter/tree-sitter '*.*.*' \
| tail --lines=1 \
| cut --delimiter='/' --fields=3 \
| sed -E 's/v([0-9]+\.[0-9]+)/\1/' \
)}
TSS="$PWD/tree-sitter" # Tree Sitter Source

if [ -n "$PLATFORM" ]
then
cli="tree-sitter-$PLATFORM"
Expand All @@ -73,16 +83,6 @@ else
cli="tree-sitter"
fi

tstag=${TREE_SITTER_VERSION:-$(\
git \
-c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' \
--tags https://github.com/tree-sitter/tree-sitter '*.*.*' \
| tail --lines=1 \
| cut --delimiter='/' --fields=3 \
| sed -E 's/v([0-9]+\.[0-9]+)/\1/' \
)}
TSS="$PWD/tree-sitter" # Tree Sitter Source

if [ ! -d "$TSS" ]
then
git clone https://github.com/tree-sitter/tree-sitter
Expand Down

0 comments on commit 9d2e7da

Please sign in to comment.