@@ -6,49 +6,50 @@ cd "$(dirname "$0")/.."
6
6
root=" $PWD "
7
7
8
8
clone_repo () {
9
- local owner=$1
10
- local name=$2
11
- local sha=$3
12
- local path=" $root /examples/$name "
13
-
14
- if [ -d " $path " ]; then
15
- pushd " $path " > /dev/null
16
- if [ " $( git rev-parse HEAD 2> /dev/null) " == " $sha " ]; then
17
- popd > /dev/null
18
- return
19
- else
20
- popd > /dev/null
21
- rm -rf " $path "
22
- echo " Updating $owner /$name to $sha "
23
- fi
24
- else
25
- echo " Cloning $owner /$name "
26
- fi
27
-
28
- mkdir -p " $path "
29
- pushd " $path " > /dev/null
30
- git init
31
- git remote add origin " https://github.com/$owner /$name "
32
- git pull --ff-only --depth 1 origin " $sha "
33
- popd > /dev/null
9
+ local owner=$1
10
+ local name=$2
11
+ local sha=$3
12
+ local path=" $root /examples/$name "
13
+
14
+ if [ -d " $path " ]; then
15
+ pushd " $path " > /dev/null
16
+ if [ " $( git rev-parse HEAD 2> /dev/null) " == " $sha " ]; then
17
+ popd > /dev/null
18
+ return
19
+ else
20
+ popd > /dev/null
21
+ rm -rf " $path "
22
+ echo " Updating $owner /$name to $sha "
23
+ fi
24
+ else
25
+ echo " Cloning $owner /$name "
26
+ fi
27
+
28
+ mkdir -p " $path "
29
+ pushd " $path " > /dev/null
30
+ git init
31
+ git remote add origin " https://github.com/$owner /$name "
32
+ git pull --ff-only --depth 1 origin " $sha "
33
+ popd > /dev/null
34
34
}
35
35
36
- clone_repo desktop desktop d1324f56d02dd9afca5d2e9da545905a7d41d671
37
- clone_repo reduxjs redux 45111a63d39a0c0fbd8b5417b2ad623718d42d66
38
- clone_repo microsoft vscode bead496a613e475819f89f08e9e882b841bc1fe8
36
+ clone_repo desktop desktop 7c5111425cab9de911f82dd7e42f92d8f7927bb1
37
+ clone_repo reduxjs redux 936e134b827a2f8022d51f6a42942e935ee2a935
38
+ clone_repo microsoft vscode 4acf2d9fd883d247b903cc9c33221e18e39bffd8
39
39
40
40
known_failures=" $( cat script/known-failures.txt) "
41
41
42
+ # shellcheck disable=SC2046
42
43
tree-sitter parse -q \
43
- ' examples/**/*.ts' \
44
- ' examples/**/*.tsx' \
45
- $( for failure in $known_failures ; do echo " !${failure} " ; done)
44
+ ' examples/**/*.ts' \
45
+ ' examples/**/*.tsx' \
46
+ $( for failure in $known_failures ; do echo " !${failure} " ; done)
46
47
47
48
example_count=$( find examples -name ' *.ts*' -or -name ' *.tx' | wc -l)
48
- failure_count=$( wc -w <<< " $known_failures" )
49
- success_count=$(( $ example_count - $ failure_count ))
50
- success_percent=$( bc -l <<< " 100*${success_count}/${example_count}" )
49
+ failure_count=$( wc -w <<< " $known_failures" )
50
+ success_count=$(( example_count - failure_count))
51
+ success_percent=$( bc -l <<< " 100*${success_count}/${example_count}" )
51
52
52
53
printf \
53
- " Successfully parsed %d of %d example files (%.1f%%)\n" \
54
- $success_count $example_count $success_percent
54
+ " Successfully parsed %d of %d example files (%.1f%%)\n" \
55
+ " $success_count " " $example_count " " $success_percent "
0 commit comments