pinokiod 3.2.50 → 3.2.52

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/bin/py.js CHANGED
@@ -11,9 +11,13 @@ class Py {
11
11
  }
12
12
  async installed() {
13
13
  let exists = await this.kernel.exists(this.kernel.bin.path("py"))
14
- if (exists) {
15
- return this.kernel.bin.installed.pip.has("fastapi") && this.kernel.bin.installed.pip.has("uvicorn") && this.kernel.bin.installed.pip.has("importlib_metadata")
16
- } else {
14
+ try {
15
+ if (exists) {
16
+ return this.kernel.bin.installed.pip.has("fastapi") && this.kernel.bin.installed.pip.has("uvicorn") && this.kernel.bin.installed.pip.has("importlib_metadata")
17
+ } else {
18
+ return false
19
+ }
20
+ } catch (e) {
17
21
  return false
18
22
  }
19
23
  }
package/kernel/index.js CHANGED
@@ -348,6 +348,29 @@ class Kernel {
348
348
  //await this.shell.init()
349
349
 
350
350
  if (this.homedir) {
351
+ await this.template.init({
352
+ kernel: this,
353
+ system,
354
+ platform: this.platform,
355
+ arch: this.arch,
356
+ proxy: (port) => {
357
+ return this.api.get_proxy_url("/proxy", port)
358
+ },
359
+ })
360
+ this.sys = new Sysinfo()
361
+ this.sys.init(this).then(async () => {
362
+ let info = this.sys.info
363
+ await fs.promises.mkdir(this.path("logs"), { recursive: true }).catch((e) => { })
364
+ await fs.promises.writeFile(this.path("logs/system.json"), JSON.stringify({
365
+ platform: this.platform,
366
+ arch: this.arch,
367
+ home: this.homedir,
368
+ ...info
369
+ }, null, 2))
370
+ this.sysinfo = info
371
+ await this.update_sysinfo()
372
+ })
373
+ /*
351
374
  this.sys = new Sysinfo()
352
375
  await this.sys.init(this)
353
376
  let info = this.sys.info
@@ -374,15 +397,18 @@ class Kernel {
374
397
  console.time("update_sysinfo")
375
398
  await this.update_sysinfo()
376
399
  console.timeEnd("update_sysinfo")
400
+ */
377
401
  console.time("shell.init")
378
- await this.shell.init()
379
- console.timeEnd("shell.init")
380
- if (this.envs) {
381
- this.template.update({
382
- env: this.envs,
383
- envs: this.envs
384
- })
385
- }
402
+ this.shell.init().then(() => {
403
+ console.timeEnd("shell.init")
404
+ if (this.envs) {
405
+ this.template.update({
406
+ env: this.envs,
407
+ envs: this.envs
408
+ })
409
+ }
410
+ })
411
+ //await this.shell.init()
386
412
  }
387
413
 
388
414
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.50",
3
+ "version": "3.2.52",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {