pinokiod 3.2.184 → 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.
@@ -299,15 +299,6 @@ create_default_packages:
299
299
  this.kernel.bin.path("miniconda", "python3.exe"),
300
300
  )
301
301
 
302
- // give full permission
303
- console.log("Give full permission")
304
- await this.kernel.bin.exec({
305
- sudo: true,
306
- message: `icacls ${install_path} /grant Users:(OI)(CI)F /T`
307
- }, (stream) => {
308
- ondata(stream)
309
- })
310
- console.log("Give full permission done")
311
302
 
312
303
  }
313
304
  ondata({ raw: `Install finished\r\n` })
@@ -397,7 +397,7 @@ class Bin {
397
397
  // check brew_installed
398
398
  console.log("checking brew installed")
399
399
  let e = await this.kernel.bin.exists("homebrew")
400
- let { stdout }= await this.kernel.bin.exec({ message: "xcode-select -p" }, (stream) => { })
400
+ let { stdout }= await this.exec({ message: "xcode-select -p" }, (stream) => { })
401
401
  let e2 = /(.*Library.*Developer.*CommandLineTools.*|.*Xcode.*Developer.*)/gi.test(stdout)
402
402
  let e3 = await this.kernel.exists("/Library/Developer/CommandLineTools")
403
403
 
@@ -408,7 +408,7 @@ class Bin {
408
408
  // - no
409
409
 
410
410
  let e4;
411
- let result = await this.kernel.bin.exec({ message: "xcode-select --version" }, (stream) => { })
411
+ let result = await this.exec({ message: "xcode-select --version" }, (stream) => { })
412
412
  if (result && result.stdout) {
413
413
  e4 = /xcode-select version ([0-9]+)/gi.exec(result.stdout)
414
414
  if (e4 && e4.length > 1) {
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.184",
3
+ "version": "3.2.186",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -2141,6 +2141,20 @@ class Server {
2141
2141
  } else {
2142
2142
  // update the py module if it's already installed
2143
2143
  console.log("not up to date")
2144
+
2145
+ // give full permission to pinokio folder on windows
2146
+ if (this.kernel.platform === "win32") {
2147
+ console.log("1 Give full permission")
2148
+ await this.kernel.bin.exec({
2149
+ sudo: true,
2150
+ message: `icacls ${this.kernel.homedir} /grant Users:(OI)(CI)F /T`
2151
+ }, (stream) => {
2152
+ ondata(stream)
2153
+ })
2154
+ console.log("1 Give full permission done")
2155
+ }
2156
+
2157
+
2144
2158
  await new Promise((resolve, reject) => {
2145
2159
  let interval = setInterval(async () => {
2146
2160
  console.log("checking mod.py")