Unnamed repository; edit this file 'description' to name the repository.
feat(bash): inject bash into builtins expecting bash code as input (#14268)
Kristoffer Plagborg Bak Sørensen 6 months ago
parent 077c901 · commit 99cea8c
-rw-r--r--runtime/queries/bash/injections.scm19
1 files changed, 19 insertions, 0 deletions
diff --git a/runtime/queries/bash/injections.scm b/runtime/queries/bash/injections.scm
index ce25a6c0..bf50c060 100644
--- a/runtime/queries/bash/injections.scm
+++ b/runtime/queries/bash/injections.scm
@@ -17,3 +17,22 @@
(string (string_content) @injection.content)
]
(#set! injection.language "jq"))
+
+(command
+ name: (command_name (word) @_command (#eq? @_command "alias"))
+ argument: (concatenation
+ (word)
+ [
+ (raw_string) @injection.content
+ (string (string_content) @injection.content)
+ ])
+ (#set! injection.language "bash"))
+
+(command
+ name: (command_name (word) @_command (#any-of? @_command "eval" "trap"))
+ .
+ argument: [
+ (raw_string) @injection.content
+ (string (string_content) @injection.content)
+ ]
+ (#set! injection.language "bash"))