mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
treesitter: add update script and update runtime
Update treesitter runtime to : 9a82dcc666d06617cbab3061467075019fae0b0d
This commit is contained in:
35
scripts/update-ts-runtime.sh
Executable file
35
scripts/update-ts-runtime.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script will update the treesitter runtime to the provided commit.
|
||||
# Usage :
|
||||
# $0 <tree-sitter commit sha>
|
||||
|
||||
ts_source_dir="/tmp/tree-sitter"
|
||||
ts_url="https://github.com/tree-sitter/tree-sitter.git"
|
||||
|
||||
base_dir="$(cd "$(dirname $(dirname $0))" && pwd)"
|
||||
ts_dest_dir="$base_dir/src/tree_sitter/"
|
||||
|
||||
echo "$ts_dest_dir"
|
||||
|
||||
if [ ! -d "$ts_source_dir" ]; then
|
||||
echo "Cloning treesitter..."
|
||||
git clone "$ts_url" "$ts_source_dir"
|
||||
else
|
||||
echo "Found a non-empty $ts_source_dir directory..."
|
||||
fi
|
||||
|
||||
echo "Checking out $1..."
|
||||
cd "$ts_source_dir"
|
||||
git -C "$ts_source_dir" checkout $1
|
||||
|
||||
echo "Removing old files..."
|
||||
find "$ts_dest_dir" -not -name "LICENSE" -not -type d -delete
|
||||
|
||||
echo "Copying files..."
|
||||
cp -t "$ts_dest_dir" -r "$ts_source_dir/lib/src"/*
|
||||
cp -t "$ts_dest_dir" "$ts_source_dir/lib/include/tree_sitter"/*
|
||||
|
||||
cd "$base_dir"
|
||||
make
|
||||
TEST_FILE="$base_dir/test/functional/lua/treesitter_spec.lua" make test
|
||||
Reference in New Issue
Block a user