pinokiod 3.2.185 → 3.2.186

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/index.js CHANGED
@@ -310,7 +310,24 @@ class Kernel {
310
310
  if (this.homedir) {
311
311
 
312
312
  // 0. create homedir
313
- await fs.promises.mkdir(this.homedir, { recursive: true }).catch((e) => {})
313
+ let home_exists = await this.exists(this.homedir)
314
+ if (!home_exists) {
315
+ await fs.promises.mkdir(this.homedir, { recursive: true }).catch((e) => {})
316
+
317
+ // If the homedir was newly created, give full permission to pinokio folder on windows
318
+ if (this.kernel.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
+ }
328
+ }
329
+
330
+
314
331
 
315
332
  // 1. check if ENVIRONMENT exists
316
333
  // if it doesn't exist, write to ~/pinokio/ENVIRONMENT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.185",
3
+ "version": "3.2.186",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -2144,14 +2144,14 @@ class Server {
2144
2144
 
2145
2145
  // give full permission to pinokio folder on windows
2146
2146
  if (this.kernel.platform === "win32") {
2147
- console.log("Give full permission")
2147
+ console.log("1 Give full permission")
2148
2148
  await this.kernel.bin.exec({
2149
2149
  sudo: true,
2150
2150
  message: `icacls ${this.kernel.homedir} /grant Users:(OI)(CI)F /T`
2151
2151
  }, (stream) => {
2152
2152
  ondata(stream)
2153
2153
  })
2154
- console.log("Give full permission done")
2154
+ console.log("1 Give full permission done")
2155
2155
  }
2156
2156
 
2157
2157