pinokiod 1.3.11 → 1.3.13

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.
@@ -539,7 +539,6 @@ class Api {
539
539
  // 1. render once
540
540
  let rpc = rawrpc
541
541
  let pass = 0;
542
- console.log("Render", { rpc, memory })
543
542
  while(true) {
544
543
  rpc = this.kernel.template.render(rpc, memory)
545
544
  if (this.kernel.template.istemplate(rpc)) {
@@ -73,7 +73,7 @@ class Conda {
73
73
  message: [
74
74
  // (this.kernel.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
75
75
  // (this.platform === 'win32' ? `activate base` : `conda activate base`),
76
- "conda config --add create_default_packages python=3.10",
76
+ `conda config --file ${this.kernel.bin.path('miniconda', 'condarc')} --add create_default_packages python=3.10`,
77
77
  //"conda update -y conda",
78
78
  "conda update -y --all",
79
79
  // handling the conda-libmamba-solver bug here: https://github.com/conda/conda-libmamba-solver/issues/283
package/kernel/shell.js CHANGED
@@ -125,6 +125,7 @@ class Shell {
125
125
  this.env.XDG_STATE_HOME = path.resolve(this.kernel.homedir, "cache", "XDG_STATE_HOME")
126
126
  this.env.GRADIO_TEMP_DIR = path.resolve(this.kernel.homedir, "cache", "GRADIO_TEMP_DIR")
127
127
  this.env.PIP_CONFIG_FILE = path.resolve(this.kernel.homedir, "pipconfig")
128
+ this.env.CONDARC = path.resolve(this.kernel.homedir, "bin", "miniconda", "condarc")
128
129
 
129
130
  this.env.PS1 = "<<PINOKIO SHELL>> "
130
131
  // this.env.PROMPT_COMMAND = "export PS1=\"<<PINOKIO SHELL>> \""
@@ -147,8 +148,6 @@ class Shell {
147
148
  }
148
149
  // custom env was passed in
149
150
 
150
- console.log("params", params)
151
-
152
151
  // override cache folders if cache is specified
153
152
  if (params.cache) {
154
153
  // cache data files
@@ -168,7 +167,6 @@ class Shell {
168
167
  ]
169
168
  for(let type of types) {
170
169
  let p = path.resolve(cache_path, type)
171
- console.log("setting", p)
172
170
  this.env[type] = p
173
171
  await fs.promises.mkdir(p, { recursive: true }).catch((e) => { })
174
172
  }
@@ -232,7 +230,6 @@ class Shell {
232
230
  // automatically add self to the shells registry
233
231
  this.kernel.shell.add(this)
234
232
 
235
- console.log("params", params)
236
233
  if (params.sudo) {
237
234
  let options = {
238
235
  name: "Pinokio",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -395,30 +395,32 @@ document.addEventListener("DOMContentLoaded", async () => {
395
395
  })
396
396
  <% } %>
397
397
  <% if (agent === "electron") { %>
398
- document.querySelector("#del-browser-cache").addEventListener("click", async (e) => {
399
- console.log("del-browser-cache")
400
- let proceed = confirm("Are you sure you wish to delete the browser cache? This will remove all cookies and site data")
401
- if (proceed) {
402
- document.querySelector(".reset-browser-cache-loading").classList.remove("hidden")
403
- document.querySelector("#del-browser-cache").classList.add("hidden")
404
- let res = await fetch("/pinokio/delete", {
405
- method: "post",
406
- headers: {
407
- "Content-Type": "application/json"
408
- },
409
- body: JSON.stringify({ type: "browser-cache" })
410
- }).then((res) => {
411
- return res.json()
412
- })
413
- console.log(res)
414
- document.querySelector(".reset-browser-cache-loading").classList.add("hidden")
415
- if (res.error) {
416
- alert(res.error)
417
- } else {
418
- location.href = location.href
398
+ if (document.querySelector("#del-browser-cache")) {
399
+ document.querySelector("#del-browser-cache").addEventListener("click", async (e) => {
400
+ console.log("del-browser-cache")
401
+ let proceed = confirm("Are you sure you wish to delete the browser cache? This will remove all cookies and site data")
402
+ if (proceed) {
403
+ document.querySelector(".reset-browser-cache-loading").classList.remove("hidden")
404
+ document.querySelector("#del-browser-cache").classList.add("hidden")
405
+ let res = await fetch("/pinokio/delete", {
406
+ method: "post",
407
+ headers: {
408
+ "Content-Type": "application/json"
409
+ },
410
+ body: JSON.stringify({ type: "browser-cache" })
411
+ }).then((res) => {
412
+ return res.json()
413
+ })
414
+ console.log(res)
415
+ document.querySelector(".reset-browser-cache-loading").classList.add("hidden")
416
+ if (res.error) {
417
+ alert(res.error)
418
+ } else {
419
+ location.href = location.href
420
+ }
419
421
  }
420
- }
421
- })
422
+ })
423
+ }
422
424
  <% } %>
423
425
  document.querySelector("form").addEventListener("submit", async (e) => {
424
426
  e.preventDefault()