File tree Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Expand file tree Collapse file tree 3 files changed +31
-6
lines changed Original file line number Diff line number Diff line change
1
+ FROM alpine:latest
2
+
3
+ RUN apk add --no-cache bash
4
+
5
+ ENTRYPOINT ["/bin/bash" , "-c" ]
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ FROM rust
3
3
4
4
RUN cargo install tree-sitter-cli
5
5
6
+ RUN apt-get update && apt-get install fd-find
7
+
6
8
# Setup parser
7
9
COPY config.json /root/.config/tree-sitter/config.json
8
10
Original file line number Diff line number Diff line change 1
1
---
2
2
tools :
3
- - name : run-tree-sitter
4
- description : Runs tree sitter in the current directory.
3
+ - name : run-tree-sitter-flow
4
+ description : Runs a flow with fd and tree sitter in the current directory.
5
5
parameters :
6
6
type : object
7
7
properties :
8
- tree_sitter_args :
8
+ fd_args :
9
9
type : string
10
- description : The args to pass to tree-sitter-cli
10
+ description : The args to pass to fd
11
+ output_dir :
12
+ type : string
13
+ description : The path to output files to
11
14
container :
12
15
image : vonwig/tree_sitter
13
16
command :
14
- - " tree-sitter {{tree_sitter_args|safe}}"
17
+ - " fdfind {{fd_args|safe}} | while read -r file; do mkdir -p \" {{output_dir|safe}}/$(dirname $file)\" && tree-sitter parse \" $file\" > \" {{output_dir|safe}}/$file.parsed\" ; done"
18
+ - name : delete_folder
19
+ description : Runs rm -rf on a folder
20
+ parameters :
21
+ type : object
22
+ properties :
23
+ path :
24
+ type : string
25
+ description : Path of the folder to delete
26
+ container :
27
+ image : vonwig/bash_alpine
28
+ command :
29
+ - " rm -rf {{path|safe}}"
15
30
---
16
31
17
32
# prompt user
18
33
19
- Use tree-sitter with args ` parse '**/*.py' > / thread/ast.txt `
34
+ Delete ` / thread/top-level/ `
20
35
36
+ Run tree-sitter-flow
37
+ fd args are ` -e py `
38
+ use ` /thread/top-level ` as output dir
You can’t perform that action at this time.
0 commit comments