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.
- package/kernel/bin/index.js +2 -0
- package/kernel/index.js +27 -18
- package/kernel/shells.js +1 -0
- package/package.json +1 -1
package/kernel/bin/index.js
CHANGED
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
|
-
|
|
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.
|
|
361
|
-
|
|
362
|
-
this.
|
|
363
|
-
|
|
364
|
-
|
|
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