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.
- package/kernel/bin/index.js +2 -0
- package/kernel/index.js +25 -18
- package/kernel/shells.js +1 -0
- package/package.json +1 -1
- package/server/index.js +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,27 @@ 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
|
+
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
package/package.json
CHANGED
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
|
|