pinokiod 3.0.19 → 3.0.21

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.
@@ -30,7 +30,7 @@ class Playwright {
30
30
  await this.kernel.exec({
31
31
  message: [
32
32
  // "npm init -y",
33
- "which npm",
33
+ // "which npm",
34
34
  // "npm config get userconfig",
35
35
  // "npm config get globalconfig",
36
36
  // "npm config list -l --loglevel verbose",
package/kernel/shell.js CHANGED
@@ -461,8 +461,8 @@ class Shell {
461
461
 
462
462
  let delimiter
463
463
  if (this.platform === "win32") {
464
- //delimiter = " && "; // must use &&. & doesn't necessariliy wait until the curruent command finishes
465
- delimiter = " & "; // must use &&. & doesn't necessariliy wait until the curruent command finishes
464
+ delimiter = " && "; // must use &&. & doesn't necessariliy wait until the curruent command finishes
465
+ //delimiter = " & "; // must use &&. & doesn't necessariliy wait until the curruent command finishes
466
466
  } else {
467
467
  delimiter = " ; ";
468
468
  }
package/kernel/shells.js CHANGED
@@ -31,13 +31,16 @@ class Shells {
31
31
  let sh = new Shell(this.kernel)
32
32
  let m
33
33
  if (this.kernel.platform === "win32") {
34
- m = "ls"
35
- } else {
36
34
  m = "dir"
35
+ } else {
36
+ m = "ls"
37
37
  }
38
38
  let response = await sh.start({
39
39
  message: m,
40
40
  env: this.kernel.bin.envs({}),
41
+ conda: {
42
+ skip: true
43
+ }
41
44
  }, async (stream) => {
42
45
  process.stdout.write(stream.raw)
43
46
  })
package/kernel/sysinfo.js CHANGED
@@ -1,4 +1,6 @@
1
1
  const system = require('systeminformation')
2
+ const fs = require('fs')
3
+ const path = require('path')
2
4
  class Sysinfo {
3
5
  async init(kernel) {
4
6
  this.kernel = kernel
@@ -93,6 +95,9 @@ class Sysinfo {
93
95
  async bluetooth() {
94
96
  this.info.bluetooth = await system.bluetoothDevices()
95
97
  }
98
+ exists(_path) {
99
+ return new Promise(r=>fs.access(_path, fs.constants.F_OK, e => r(!e)))
100
+ }
96
101
  async env () {
97
102
  let cmd
98
103
  if (this.kernel.platform === "win32") {
@@ -107,8 +112,19 @@ class Sysinfo {
107
112
  // console.log(_res)
108
113
  // console.log("############### DEBUGGING ENV FINISH")
109
114
 
110
- let res = await this.kernel.bin.exec({ message: cmd }, (stream) => {
111
- })
115
+ let conda_path = path.resolve(this.kernel.homedir, "bin", "miniconda")
116
+ let conda_exists = await this.exists(conda_path)
117
+
118
+ let res
119
+ if (conda_exists) {
120
+ res = await this.kernel.bin.exec({ message: cmd }, (stream) => {
121
+ })
122
+ } else {
123
+ console.log("skip conda")
124
+ res = await this.kernel.bin.exec({ message: cmd, conda: { skip: true } }, (stream) => {
125
+ })
126
+ }
127
+
112
128
  let lines = res.response.split(/[\r\n]+/)
113
129
  let vars = []
114
130
  let started
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.0.19",
3
+ "version": "3.0.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {