pinokiod 3.321.0 → 3.322.0

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/bin/git.js CHANGED
@@ -8,7 +8,8 @@ class Git {
8
8
  if (this.kernel.platform === "darwin") {
9
9
  return "git git-lfs gh=2.82.1"
10
10
  } else if (this.kernel.platform === "win32") {
11
- return "git git-lfs gh=2.82.1 git-bash"
11
+ //return "git git-lfs gh=2.82.1 git-bash"
12
+ return "git git-lfs gh=2.82.1 m2-base"
12
13
  } else {
13
14
  return "git git-lfs gh=2.82.1"
14
15
  }
@@ -26,7 +27,8 @@ class Git {
26
27
  if (this.kernel.platform === "darwin") {
27
28
  return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh")
28
29
  } else if (this.kernel.platform === "win32") {
29
- return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh") && this.kernel.bin.installed.conda.has("git-bash")
30
+ //return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh") && this.kernel.bin.installed.conda.has("git-bash")
31
+ return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh") && this.kernel.bin.installed.conda.has("m2-base")
30
32
  } else {
31
33
  return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh")
32
34
  }
@@ -11,7 +11,7 @@
11
11
  required = true
12
12
  [user]
13
13
  name = pinokio
14
- email = pinokio
14
+ email = pinokio@localhost
15
15
  [init]
16
16
  defaultBranch = main
17
17
  [push]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.321.0",
3
+ "version": "3.322.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -182,6 +182,9 @@ class Server {
182
182
  async ensureGitconfigDefaults(home) {
183
183
  const gitconfigPath = path.resolve(home, "gitconfig")
184
184
  const templatePath = path.resolve(__dirname, "..", "kernel", "gitconfig_template")
185
+ const defaultName = "pinokio"
186
+ const defaultEmail = "pinokio@localhost"
187
+ const hasEmailShape = (value) => typeof value === "string" && value.includes("@")
185
188
  const required = [
186
189
  { section: "init", key: "defaultBranch", value: "main" },
187
190
  { section: "push", key: "autoSetupRemote", value: true },
@@ -214,6 +217,23 @@ class Server {
214
217
  }
215
218
  }
216
219
 
220
+ if (!config.user) {
221
+ config.user = {}
222
+ }
223
+ const name = (typeof config.user.name === "string") ? config.user.name : ""
224
+ if (!name.trim()) {
225
+ config.user.name = defaultName
226
+ dirty = true
227
+ }
228
+ const email = (typeof config.user.email === "string") ? config.user.email.trim() : ""
229
+ if (!hasEmailShape(email)) {
230
+ config.user.email = defaultEmail
231
+ dirty = true
232
+ } else if (email !== config.user.email) {
233
+ config.user.email = email
234
+ dirty = true
235
+ }
236
+
217
237
  if (dirty) {
218
238
  await fs.promises.writeFile(gitconfigPath, ini.stringify(config))
219
239
  }