pinokiod 3.2.188 → 3.2.190

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,29 @@ 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
+ if (this.envs) {
357
+ this.template.update({
358
+ env: this.envs,
359
+ envs: this.envs
360
+ })
361
+ }
362
+ console.log({ grant_permission })
363
+ if (grant_permission) {
364
+ if (this.platform === "win32") {
365
+ console.log("2 Give full permission")
366
+ await this.bin.exec({
367
+ sudo: true,
368
+ message: `icacls ${this.homedir} /grant Users:(OI)(CI)F /T`
369
+ }, (stream) => {
370
+ ondata(stream)
371
+ })
372
+ console.log("2 Give full permission done")
373
+ }
374
+ }
375
+ })
376
+ }
368
377
  })
369
378
  let ts2 = Date.now()
370
379
  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.188",
3
+ "version": "3.2.190",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {