pinokiod 2.15.45 → 2.15.47

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.
@@ -10,6 +10,7 @@ const { glob, sync, hasMagic } = require('glob-gitignore')
10
10
  const fastq = require('fastq')
11
11
  const Loader = require("../loader")
12
12
  const Environment = require("../environment")
13
+ const Util = require('../util')
13
14
 
14
15
  class Api {
15
16
  constructor(kernel) {
@@ -739,6 +740,27 @@ class Api {
739
740
  rpc,
740
741
  rawrpc
741
742
  })
743
+
744
+ // if there's an error, set the PINOKIO_SCRIPT_DEFAULT to false
745
+
746
+ /*
747
+ req := {
748
+ "method": "env.set",
749
+ "params": {
750
+ <key>: <val>,
751
+ <key>: <val>,
752
+ }
753
+ }
754
+ */
755
+ // write to current app folder's ENVIRONMENT
756
+ console.log("request", request)
757
+ let api_path = Util.api_path(request.path, this.kernel)
758
+ console.log("api_path", api_path)
759
+ let env_path = path.resolve(api_path, "ENVIRONMENT")
760
+ console.log("env_path", env_path)
761
+ await Util.update_env(env_path, {
762
+ PINOKIO_SCRIPT_DEFAULT: "false"
763
+ })
742
764
  return
743
765
  }
744
766
 
package/kernel/shells.js CHANGED
@@ -59,22 +59,12 @@ class Shells {
59
59
  console.log("Message Array", params.message)
60
60
  for(let i=0; i<params.message.length; i++) {
61
61
  let message = params.message[i]
62
- let params = Object.assign({}, params)
63
- params.message = message
64
- console.log("Launching Message", params)
65
- res = await this._launch(params, options, ondata)
66
- // if there's an error, trigger an error event
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, immediately return with the error
67
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
68
  return res
79
69
  }
80
70
  }
@@ -206,9 +196,6 @@ class Shells {
206
196
  }
207
197
  }
208
198
  }
209
-
210
- console.log("Line before", line)
211
-
212
199
  // 3. Now with all the `break: false` (ignored patterns) gone, look for the `break: true` patterns
213
200
  for(let handler of breakPoints) {
214
201
  if (handler.event) {
@@ -218,16 +205,11 @@ class Shells {
218
205
  }
219
206
  let re = new RegExp(matches[1], matches[2])
220
207
 
221
- console.log("re", re)
222
-
223
208
  // only the "break: true" ones
224
209
  if (handler.break) {
225
- console.log("checking break handler", handler)
226
-
227
210
  let match;
228
211
  // Keep executing the regex on the text until no more matches are found
229
212
  while ((match = re.exec(line)) !== null) {
230
- console.log("match found", match)
231
213
  errors.add(match[0])
232
214
  // errors.add(match.slice(1));
233
215
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.15.45",
3
+ "version": "2.15.47",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -432,7 +432,8 @@ document.addEventListener("DOMContentLoaded", async () => {
432
432
 
433
433
 
434
434
 
435
- document.querySelector("footer .content").innerHTML = document.querySelector("footer .content").innerHTML + `<pre class='error'>${packet.data}</pre>`
435
+ //document.querySelector("footer .content").innerHTML = document.querySelector("footer .content").innerHTML + `<pre class='error'>${packet.data}</pre>`
436
+ document.querySelector("footer .content").innerHTML = document.querySelector("footer .content").innerHTML + `<pre class='error'>ERROR</pre>`
436
437
  // document.querySelector("footer .toggle-expand i").className = "fa-solid fa-circle-chevron-down"
437
438
  // document.querySelector("footer").classList.add("expanded")
438
439
  document.querySelector("footer i").className = "fa-solid fa-triangle-exclamation"