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

Add a script to update parsers to latest. #9

Merged
merged 2 commits into from
May 16, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ${{ matrix.target.os }}
env:
PLATFORM: ${{ matrix.target.platform }}
TREE_SITTER_VERSION: 0.22.6
steps:
- uses: actions/checkout@v2
- name: Build for ${{ matrix.target.platform }}
Expand Down
9 changes: 8 additions & 1 deletion lang
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ shift
# Clone and Build tree-sitter #
# ################################################ #

tstag="0.22.6"
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" ]
Expand Down
15 changes: 15 additions & 0 deletions update/ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# /usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

tree_sitter='https://github.com/tree-sitter/tree-sitter'
langs=$(cat $PWD/ref | cut -d ':' -f 1)

for lang in $langs
do
ref=$(git ls-remote "$tree_sitter-$lang" refs/heads/master | sed -E 's/^([0-9a-fA-F]+)\s.*$/\1/')
echo "$lang:$ref" >> ref.new
done

mv ref.new ref
Loading