Skip to content

Commit 96ab345

Browse files
Initial add scripts/sync_upstream.sh
1 parent 97706a1 commit 96ab345

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

scripts/sync_upstream.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
#
3+
# This script is used to sync the upstream tree-sitter-swift grammar with the one used in this project.
4+
#
5+
6+
function sync_upstream_swift() {
7+
rm -fr tree-sitter-swift
8+
mkdir -p tree-sitter-swift
9+
cd tree-sitter-swift
10+
wget https://github.com/alex-pinkus/tree-sitter-swift/releases/download/0.7.1-pypi/tree-sitter-swift.tar.gz
11+
tar -xzf tree-sitter-swift.tar.gz
12+
cd ..
13+
cp -vf tree-sitter-swift/src/*.c Sources/TreeSitterSwift/src
14+
cp -vf tree-sitter-swift/src/tree_sitter/*.h Sources/TreeSitterSwift/src/tree_sitter/
15+
cp -vf bindings/swift/TreeSitterSwift/swift.h Sources/TreeSitterSwift/include/public.h
16+
cp -vf tree-sitter-swift/queries/locals.scm Sources/TreeSitterSwiftQueries/locals.scm
17+
cp -vf tree-sitter-swift/queries/highlights.scm Sources/TreeSitterSwiftQueries/highlights.scm
18+
}
19+
20+
function sync_upstream() {
21+
sync_upstream_swift
22+
}
23+
24+
sync_upstream

0 commit comments

Comments
 (0)