pinokiod 3.2.187 → 3.2.189

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.
@@ -142,7 +142,9 @@ class Bin {
142
142
  this.vs_path_env = mod.mod.env(this.kernel)
143
143
  return null
144
144
  } else {
145
+ console.log({ mod })
145
146
  if (mod.mod.env) {
147
+ console.log("env", mod.mod.env)
146
148
  return mod.mod.env(this.kernel)
147
149
  } else {
148
150
  return null
package/kernel/index.js CHANGED
@@ -307,24 +307,18 @@ class Kernel {
307
307
  this.procs = {}
308
308
  this.template = new Template()
309
309
  try {
310
+ let grant_permission = false
311
+ console.log(">>>>>> this.homedir", this.homedir)
310
312
  if (this.homedir) {
311
313
 
312
314
  // 0. create homedir
313
315
  let home_exists = await this.exists(this.homedir)
316
+ console.log({ home_exists, homedir: this.homedir })
314
317
  if (!home_exists) {
315
318
  await fs.promises.mkdir(this.homedir, { recursive: true }).catch((e) => {})
316
319
 
317
320
  // If the homedir was newly created, give full permission to pinokio folder on windows
318
- if (this.platform === "win32") {
319
- console.log("2 Give full permission")
320
- await this.bin.exec({
321
- sudo: true,
322
- message: `icacls ${this.homedir} /grant Users:(OI)(CI)F /T`
323
- }, (stream) => {
324
- ondata(stream)
325
- })
326
- console.log("2 Give full permission done")
327
- }
321
+ grant_permission = true
328
322
  }
329
323
 
330
324
 
@@ -357,14 +351,27 @@ class Kernel {
357
351
  let ts = Date.now()
358
352
  this.bin.init().then(() => {
359
353
  console.log("bin init finished")
360
- this.shell.init().then(() => {
361
- if (this.envs) {
362
- this.template.update({
363
- env: this.envs,
364
- envs: this.envs
365
- })
366
- }
367
- })
354
+ if (this.homedir) {
355
+ this.shell.init().then(async () => {
356
+ console.log(">>>>>> this.envs", this.envs)
357
+ if (this.envs) {
358
+ this.template.update({
359
+ env: this.envs,
360
+ envs: this.envs
361
+ })
362
+ }
363
+ if (this.platform === "win32") {
364
+ console.log("2 Give full permission")
365
+ await this.bin.exec({
366
+ sudo: true,
367
+ message: `icacls ${this.homedir} /grant Users:(OI)(CI)F /T`
368
+ }, (stream) => {
369
+ ondata(stream)
370
+ })
371
+ console.log("2 Give full permission done")
372
+ }
373
+ })
374
+ }
368
375
  })
369
376
  let ts2 = Date.now()
370
377
  await this.api.init()
package/kernel/shells.js CHANGED
@@ -27,6 +27,7 @@ class Shells {
27
27
  }
28
28
  */
29
29
  async init() {
30
+ console.log("SHELLS>INIT")
30
31
  // iterate through all the envs
31
32
  let sh = new Shell(this.kernel)
32
33
  let m
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.187",
3
+ "version": "3.2.189",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -2109,7 +2109,7 @@ class Server {
2109
2109
  let ex = await this.kernel.exists(this.kernel.homedir, "ENVIRONMENT")
2110
2110
  if (!ex) {
2111
2111
  let str = await Environment.ENV("system", this.kernel.homedir)
2112
- await fs.promises.writeFile(path.resolve(this.homedir, "ENVIRONMENT"), str)
2112
+ await fs.promises.writeFile(path.resolve(this.kernel.homedir, "ENVIRONMENT"), str)
2113
2113
  }
2114
2114
  }
2115
2115