pinokiod 3.321.0 → 3.323.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 +16 -4
- package/kernel/gitconfig_template +1 -1
- package/package.json +1 -1
- package/server/index.js +20 -0
package/kernel/bin/git.js
CHANGED
|
@@ -6,11 +6,12 @@ const path = require("path")
|
|
|
6
6
|
class Git {
|
|
7
7
|
cmd() {
|
|
8
8
|
if (this.kernel.platform === "darwin") {
|
|
9
|
-
return "git git-lfs gh=2.82.1"
|
|
9
|
+
return "git=2.51.0 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=2.51.0 git-lfs gh=2.82.1 m2-base"
|
|
12
13
|
} else {
|
|
13
|
-
return "git git-lfs gh=2.82.1"
|
|
14
|
+
return "git=2.51.0 git-lfs gh=2.82.1"
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
async install(req, ondata) {
|
|
@@ -23,10 +24,21 @@ class Git {
|
|
|
23
24
|
}, ondata)
|
|
24
25
|
}
|
|
25
26
|
async installed() {
|
|
27
|
+
let version = this.kernel.bin.installed.conda_versions.git
|
|
28
|
+
console.log("git version", version)
|
|
29
|
+
let coerced = semver.coerce(version)
|
|
30
|
+
console.log("git coerced", coerced)
|
|
31
|
+
let requirement = ">=2.51.0"
|
|
32
|
+
let satisfied = semver.satisfies(coerced, requirement)
|
|
33
|
+
console.log("git version satisfied?", satisfied)
|
|
34
|
+
if (!satisfied) {
|
|
35
|
+
return false
|
|
36
|
+
}
|
|
26
37
|
if (this.kernel.platform === "darwin") {
|
|
27
38
|
return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh")
|
|
28
39
|
} 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")
|
|
40
|
+
//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")
|
|
41
|
+
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
42
|
} else {
|
|
31
43
|
return this.kernel.bin.installed.conda && this.kernel.bin.installed.conda.has("git") && this.kernel.bin.installed.conda.has("gh")
|
|
32
44
|
}
|
package/package.json
CHANGED
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
|
}
|