pinokiod 3.2.224 → 3.2.226

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.
@@ -139,14 +139,16 @@ class Api {
139
139
  console.log("STOP modpath", modpath)
140
140
  console.log("this.mods before", this.mods)
141
141
  console.log("this.child_procs before", this.child_procs)
142
- let child_procs = Array.from(this.child_procs[modpath])
143
- for(let proc of child_procs) {
144
- console.log("reset child proc", proc)
145
- delete this.mods[proc]
142
+ if (this.child_procs[modpath]) {
143
+ let child_procs = Array.from(this.child_procs[modpath])
144
+ for(let proc of child_procs) {
145
+ console.log("reset child proc", proc)
146
+ delete this.mods[proc]
147
+ }
148
+ delete this.child_procs[modpath]
149
+ console.log("this.mods after", this.mods)
150
+ console.log("this.child_procs after", this.child_procs)
146
151
  }
147
- delete this.child_procs[modpath]
148
- console.log("this.mods after", this.mods)
149
- console.log("this.child_procs after", this.child_procs)
150
152
 
151
153
 
152
154
  // stop all shell processes connected to the uri
package/kernel/index.js CHANGED
@@ -497,17 +497,23 @@ class Kernel {
497
497
  console.log(e)
498
498
  if (e.PINOKIO_SCRIPT_AUTOLAUNCH) {
499
499
  let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
500
- console.log("AUTOLAUNCHING", autolaunch_path)
501
- let res = await new Promise((resolve, reject) => {
502
- this.api.process({
503
- uri: autolaunch_path,
504
- input: {}
505
- // client: req.client,
506
- // caller: req.parent.path,
507
- }, (r) => {
508
- resolve(r.input)
500
+ let exists = await this.exists(autolaunch_path)
501
+ console.log("ATTEMPTING AUTOLAUNCH", autolaunch_path)
502
+ if (exists) {
503
+ console.log("SCRIPT EXISTS. Starting...", autolaunch_path)
504
+ let res = await new Promise((resolve, reject) => {
505
+ this.api.process({
506
+ uri: autolaunch_path,
507
+ input: {}
508
+ // client: req.client,
509
+ // caller: req.parent.path,
510
+ }, (r) => {
511
+ resolve(r.input)
512
+ })
509
513
  })
510
- })
514
+ } else {
515
+ console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
516
+ }
511
517
  }
512
518
  }
513
519
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.224",
3
+ "version": "3.2.226",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {