pinokiod 3.2.190 → 3.2.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/kernel/shells.js +15 -13
- package/package.json +1 -1
package/kernel/shells.js
CHANGED
|
@@ -127,21 +127,23 @@ class Shells {
|
|
|
127
127
|
matches[2] += "g" // if g option is not included, include it (need it for matchAll)
|
|
128
128
|
}
|
|
129
129
|
let re = new RegExp(matches[1], matches[2])
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
if (stream.cleaned) {
|
|
131
|
+
let line = stream.cleaned.replaceAll(/[\r\n]/g, "")
|
|
132
|
+
//let rendered_event = [...stream.cleaned.matchAll(re)]
|
|
132
133
|
|
|
133
134
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
let rendered_event = [...line.matchAll(re)]
|
|
136
|
+
// 3. if the rendered expression is truthy, run the "run" script
|
|
137
|
+
if (rendered_event.length > 0) {
|
|
138
|
+
stream.matches = rendered_event
|
|
139
|
+
if (handler.kill) {
|
|
140
|
+
m = rendered_event[0]
|
|
141
|
+
sh.kill()
|
|
142
|
+
}
|
|
143
|
+
if (handler.done) {
|
|
144
|
+
m = rendered_event[0]
|
|
145
|
+
sh.continue()
|
|
146
|
+
}
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
}
|