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.
- package/kernel/index.js +28 -23
- 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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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) {
|