pinokiod 3.2.237 → 3.2.238

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.
Files changed (2) hide show
  1. package/kernel/index.js +28 -23
  2. package/package.json +1 -1
package/kernel/index.js CHANGED
@@ -491,31 +491,36 @@ class Kernel {
491
491
  })
492
492
 
493
493
  // get env
494
- for(let api of this.i.api) {
495
- let env_path = path.resolve(this.api.userdir, api.path)
496
- let e = await Environment.get(env_path)
497
- console.log(e)
498
- if (e.PINOKIO_SCRIPT_AUTOLAUNCH && e.PINOKIO_SCRIPT_AUTOLAUNCH.trim().length > 0) {
499
- let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
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
- })
513
- })
514
- } else {
515
- console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
494
+ let interval = setInterval(() => {
495
+ if (this.i) {
496
+ for(let api of this.i.api) {
497
+ let env_path = path.resolve(this.api.userdir, api.path)
498
+ let e = await Environment.get(env_path)
499
+ console.log(e)
500
+ if (e.PINOKIO_SCRIPT_AUTOLAUNCH && e.PINOKIO_SCRIPT_AUTOLAUNCH.trim().length > 0) {
501
+ let autolaunch_path = path.resolve(env_path, e.PINOKIO_SCRIPT_AUTOLAUNCH)
502
+ let exists = await this.exists(autolaunch_path)
503
+ console.log("ATTEMPTING AUTOLAUNCH", autolaunch_path)
504
+ if (exists) {
505
+ console.log("SCRIPT EXISTS. Starting...", autolaunch_path)
506
+ let res = await new Promise((resolve, reject) => {
507
+ this.api.process({
508
+ uri: autolaunch_path,
509
+ input: {}
510
+ // client: req.client,
511
+ // caller: req.parent.path,
512
+ }, (r) => {
513
+ resolve(r.input)
514
+ })
515
+ })
516
+ } else {
517
+ console.log("SCRIPT DOES NOT EXIST. Ignoring.", autolaunch_path)
518
+ }
519
+ }
516
520
  }
521
+ clearInterval(interval)
517
522
  }
518
- }
523
+ }, 1000)
519
524
  }
520
525
  // console.log({ grant_permission })
521
526
  // if (grant_permission) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.237",
3
+ "version": "3.2.238",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {