Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
; inherits: toml

; This part covers simple tasks where only the command(s) to run
; are specified as a string or array of strings, e.g.
;
;    [tasks]
;    simple = "simple-command arg1 arg2"
;    many-simple = [
;      "simple-command-1",
;      "simple-command-2",
;    ]
;
(table
  (bare_key) @table-name (#eq? @table-name "tasks")
  (pair (_) [
    ((string) @injection.shebang @injection.content (#set! injection.language "bash"))
    ((array (string) @injection.shebang @injection.content (#set! injection.language "bash")))
  ])
)

; This part covers advanced tasks which are specified as a table.
; Only the "run" key is subject to injections.
;
;    [tasks.foo]
;    description = "This is regular text."
;    run = "this is bash"
;
(table
  (dotted_key (bare_key) @table-name (#eq? @table-name "tasks"))
  (pair (bare_key) @key-name (#eq? @key-name "run") [
    ((string) @injection.shebang @injection.content (#set! injection.language "bash"))
    ((array (string) @injection.shebang @injection.content (#set! injection.language "bash")))
  ])
)