pinokiod 2.15.44 → 2.15.46

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.
@@ -730,6 +730,7 @@ class Api {
730
730
 
731
731
 
732
732
  if (result && result.error) {
733
+ console.log("RESULT CONTAINED ERROR. HALT")
733
734
  this.ondata({
734
735
  id: request.path,
735
736
  type: "error",
package/kernel/shells.js CHANGED
@@ -53,6 +53,40 @@ class Shells {
53
53
 
54
54
  }
55
55
  async launch(params, options, ondata) {
56
+ // if array, duplicate the action
57
+ if (Array.isArray(params.message)) {
58
+ let res
59
+ console.log("Message Array", params.message)
60
+ for(let i=0; i<params.message.length; i++) {
61
+ let message = params.message[i]
62
+ let params_dup = Object.assign({}, params)
63
+ params_dup.message = message
64
+ console.log("Launching Message", params_dup)
65
+ res = await this._launch(params_dup, options, ondata)
66
+ // if there's an error, trigger an error event
67
+ if (res.error) {
68
+ console.log("Error exists. Trigger an error", { res })
69
+ ondata({
70
+ id: res.id,
71
+ type: "error",
72
+ data: res.response,
73
+ event: res.error,
74
+ // rpc,
75
+ // rawrpc
76
+ })
77
+ // if there's an error, return immediately => so it will NOT go forward and stop the script
78
+ return res
79
+ }
80
+ }
81
+ console.log("Launch Message Array Finished", res)
82
+ return res
83
+ } else {
84
+ console.log("Single Message", params.message)
85
+ let res = await this._launch(params, options, ondata)
86
+ return res
87
+ }
88
+ }
89
+ async _launch(params, options, ondata) {
56
90
  // iterate through all the envs
57
91
  params.env = this.kernel.bin.envs(params.env)
58
92
 
@@ -126,6 +160,8 @@ class Shells {
126
160
  ondata(stream)
127
161
  })
128
162
 
163
+ console.log(">>>>>> RESPONSE", response)
164
+
129
165
  /*
130
166
  {
131
167
  method: "shell.run",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.44",
3
+ "version": "2.15.46",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {