pinokiod 3.9.3 → 3.9.13

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.
@@ -12,7 +12,7 @@ class PeerVariableRouter extends Processor {
12
12
  let local_variables = peer.memory.local[script_path]
13
13
  for(let key in local_variables) {
14
14
  let val = local_variables[key]
15
- if (val.startsWith("http")) {
15
+ if (typeof val === "string" && val.startsWith("http")) {
16
16
  let dial = val.replace(/https?:\/\//, '')
17
17
  let name = this.api_name(peer.platform, peer.home, script_path)
18
18
  if (this.has_port(dial)) {
package/kernel/shell.js CHANGED
@@ -1005,6 +1005,20 @@ class Shell {
1005
1005
  }
1006
1006
 
1007
1007
 
1008
+ if (this.kernel.api.running[this.id]) {
1009
+ delete this.kernel.api.running[this.id]
1010
+ }
1011
+ if (this.kernel.memory.local[this.id]) {
1012
+ delete this.kernel.memory.local[this.id]
1013
+ }
1014
+
1015
+ // this.ondata({
1016
+ // id: this.id,
1017
+ // type: "disconnect"
1018
+ // })
1019
+ this.kernel.refresh(true)
1020
+
1021
+
1008
1022
  }
1009
1023
  log() {
1010
1024
  let buf = this.vts.serialize()
package/kernel/util.js CHANGED
@@ -91,6 +91,24 @@ const parse_env = async (filename) => {
91
91
  return {}
92
92
  }
93
93
  }
94
+ const run = (cmd, cwd, kernel) => {
95
+ child_process.exec(cmd, { cwd })
96
+ /*
97
+ if (kernel) {
98
+ kernel.exec({
99
+ message: cmd,
100
+ path: cwd
101
+ }, (e) => {
102
+ process.stdout.write(e.raw)
103
+ }).then(() => {
104
+ console.log("DONE")
105
+ })
106
+ } else {
107
+ child_process.exec(command)
108
+ }
109
+ */
110
+
111
+ }
94
112
  const openfs = (dirPath, options, kernel) => {
95
113
  let command = '';
96
114
  const platform = os.platform()
@@ -344,5 +362,5 @@ function fill_object(obj, pattern, list, cache) {
344
362
  }
345
363
 
346
364
  module.exports = {
347
- parse_env, log_path, api_path, update_env, parse_env_detail, openfs, port_running, du, is_port_available, find_python, find_venv, fill_object
365
+ parse_env, log_path, api_path, update_env, parse_env_detail, openfs, port_running, du, is_port_available, find_python, find_venv, fill_object, run
348
366
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.9.3",
3
+ "version": "3.9.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {