pinokiod 3.9.23 → 3.9.25

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.
@@ -68,7 +68,8 @@ class Api {
68
68
  // }
69
69
  // }
70
70
 
71
- meta.iconpath = meta.icon ? path.resolve(api_path, meta.icon) : null
71
+ meta.iconpath = meta.icon ? meta.icon : null
72
+ //meta.iconpath = meta.icon ? path.resolve(api_path, meta.icon) : null
72
73
  meta.icon = meta.icon ? `/api/${api_name}/${meta.icon}?raw=true` : "/pinokio-black.png"
73
74
  meta.path = api_path
74
75
  meta.name = meta.title
@@ -255,7 +255,11 @@ report_errors: false`)
255
255
  return req.dependencies.includes(m.name)
256
256
  // return ["zip", "uv", "node", "huggingface", "gxx", "git", "ffmpeg", "caddy"].includes(m.name)
257
257
  }).map((m) => {
258
- return m.mod.cmd()
258
+ if (m.mod.cmd) {
259
+ return m.mod.cmd()
260
+ } else {
261
+ return ""
262
+ }
259
263
  }).join(" ")
260
264
  console.log("Conda dependencies to install", { mods })
261
265
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.9.23",
3
+ "version": "3.9.25",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -102,11 +102,7 @@ class Server {
102
102
  return new Promise(r=>fs.access(s, fs.constants.F_OK, e => r(!e)))
103
103
  }
104
104
  async updateMeta(formData, app_path) {
105
- if (formData.icon_dirty) {
106
- // write icon file
107
- let icon_path = this.kernel.path("api", formData.new_path, formData.icon_path)
108
- await fs.promises.writeFile(icon_path, formData.avatar)
109
- }
105
+ console.log("updateMeta", formData)
110
106
 
111
107
  // write title/description to pinokio.json
112
108
  let dirty
@@ -127,7 +123,18 @@ class Server {
127
123
  menu: []
128
124
  }
129
125
  }
126
+
127
+ if (formData.icon_dirty) {
128
+ //
129
+ // write icon file
130
+ let icon_path = this.kernel.path("api", formData.new_path, formData.icon_path)
131
+ console.log({ icon_path })
132
+ await fs.promises.writeFile(icon_path, formData.avatar)
133
+ meta.icon = formData.icon_path
134
+ dirty = true
135
+ }
130
136
  if (dirty) {
137
+ console.log("Save", meta_path, meta)
131
138
  await fs.promises.writeFile(meta_path, JSON.stringify(meta, null, 2))
132
139
  }
133
140
  }
@@ -4263,6 +4270,7 @@ class Server {
4263
4270
  // 1. copy first
4264
4271
  let old_path = this.kernel.path("api", formData.old_path)
4265
4272
  let new_path = this.kernel.path("api", formData.new_path)
4273
+
4266
4274
  console.log({ old_path, new_path })
4267
4275
  await fs.promises.cp(old_path, new_path, { recursive: true })
4268
4276