pinokiod 3.5.15 → 3.5.17

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.
Files changed (2) hide show
  1. package/kernel/index.js +23 -18
  2. package/package.json +1 -1
package/kernel/index.js CHANGED
@@ -371,25 +371,30 @@ class Kernel {
371
371
  }
372
372
  }
373
373
  async initHome() {
374
- // first make dir
375
- await fs.promises.mkdir(this.homedir, { recursive: true }).catch((e) => {})
376
- // then wait until the app launches, and when it launches, grant access
377
- if (this.platform === "win32") {
378
- console.log("[initHome] Wait until the app launches")
379
- let interval = setInterval(async () => {
380
- console.log("[initHome] Has the app launched?", this.launch_complete)
381
- if (this.launch_complete) {
382
- console.log("[initHome] 1 Give full permission")
383
- clearInterval(interval)
384
- await this.bin.exec({
385
- sudo: true,
386
- message: `icacls ${this.homedir} /grant *S-1-1-0:(OI)(CI)F /T`
387
- }, (stream) => {
388
- process.stdout.write(stream.raw)
389
- })
390
- console.log("[initHome] 2 Give full permission done")
374
+ if (this.homedir) {
375
+ let home_exists = await this.exists(this.homedir)
376
+ if (!home_exists) {
377
+ // first make dir
378
+ await fs.promises.mkdir(this.homedir, { recursive: true }).catch((e) => {})
379
+ // then wait until the app launches, and when it launches, grant access
380
+ if (this.platform === "win32") {
381
+ console.log("[initHome] Wait until the app launches")
382
+ let interval = setInterval(async () => {
383
+ console.log("[initHome] Has the app launched?", this.launch_complete)
384
+ if (this.launch_complete) {
385
+ console.log("[initHome] 1 Give full permission")
386
+ clearInterval(interval)
387
+ await this.bin.exec({
388
+ sudo: true,
389
+ message: `icacls ${this.homedir} /grant *S-1-1-0:(OI)(CI)F /T`
390
+ }, (stream) => {
391
+ process.stdout.write(stream.raw)
392
+ })
393
+ console.log("[initHome] 2 Give full permission done")
394
+ }
395
+ }, 1000)
391
396
  }
392
- }, 1000)
397
+ }
393
398
  }
394
399
  }
395
400
  async init(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.5.15",
3
+ "version": "3.5.17",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {