pinokiod 3.2.82 → 3.2.83
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/brew.js +40 -11
- package/package.json +1 -1
package/kernel/bin/brew.js
CHANGED
|
@@ -19,19 +19,48 @@ class Brew {
|
|
|
19
19
|
await this.kernel.bin.rm("Homebrew.zip", ondata)
|
|
20
20
|
|
|
21
21
|
if (this.kernel.platform === "darwin") {
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// command line tools
|
|
23
|
+
let e4;
|
|
24
|
+
let result = await this.kernel.bin.exec({ message: "xcode-select --version" }, (stream) => { })
|
|
25
|
+
if (result && result.stdout) {
|
|
26
|
+
e4 = /xcode-select version ([0-9]+)/gi.exec(result.stdout)
|
|
27
|
+
if (e4.length > 1) {
|
|
28
|
+
let version = Number(e4[1])
|
|
29
|
+
console.log("xcode-select version", version)
|
|
30
|
+
if (version >= 2349) {
|
|
31
|
+
e4 = true
|
|
32
|
+
} else {
|
|
33
|
+
e4 = false
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
e4 = false
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
e4 = false
|
|
40
|
+
}
|
|
24
41
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
console.log("> e4", e4)
|
|
43
|
+
|
|
44
|
+
if (!e4) {
|
|
45
|
+
console.log("install the latest xcode build tools")
|
|
46
|
+
// not installed or not installed properly
|
|
47
|
+
// install xcode build tools
|
|
48
|
+
await this.kernel.bin.exec({ sudo: true, conda: { skip: true }, message: "rm -rf /Library/Developer/CommandLineTools" }, (stream) => { ondata(stream) })
|
|
49
|
+
let sh_path = path.resolve(this.kernel.homedir, "xcode.sh")
|
|
50
|
+
let src_path = path.resolve(__dirname, "xcode.sh")
|
|
51
|
+
console.log({ sh_path, src_path })
|
|
52
|
+
let sh = await fs.promises.readFile(src_path, "utf8")
|
|
53
|
+
console.log({ sh })
|
|
54
|
+
await fs.promises.writeFile(sh_path, sh)
|
|
55
|
+
await this.kernel.bin.exec({ message: "bash ./xcode.sh", path: this.kernel.homedir, conda: { skip: true }}, (stream) => { ondata(stream) })
|
|
56
|
+
|
|
57
|
+
ondata({ raw: "installing xcode-select. please approve the xcode-select install dialog and install before proceeding...\r\n" })
|
|
58
|
+
await this.kernel.bin.exec({ message: "xcode-select --install", conda: { skip: true } }, (stream) => { ondata(stream) })
|
|
59
|
+
|
|
60
|
+
} else {
|
|
61
|
+
console.log("no need to install xcode build tools")
|
|
62
|
+
}
|
|
32
63
|
|
|
33
|
-
ondata({ raw: "installing xcode-select. please approve the xcode-select install dialog and install before proceeding...\r\n" })
|
|
34
|
-
await this.kernel.bin.exec({ message: "xcode-select --install", conda: { skip: true } }, (stream) => { ondata(stream) })
|
|
35
64
|
|
|
36
65
|
//ondata({ raw: "Setting CommandLineTools path...\r\n" })
|
|
37
66
|
//await this.kernel.bin.exec({ sudo: true, message: "xcode-select -switch /Library/Developer/CommandLineTools" }, (stream) => { ondata(stream) })
|