1 | let { getEdgeBetaPath, getEdgeCanaryPath, getEdgeDevPath, getEdgePath } = require("..")
|
2 |
|
3 | let { execFile } = require("child_process")
|
4 | const { promisify } = require("util")
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | async function check(binaryPath, shouldBe) {
|
10 | shouldBe = shouldBe.toLowerCase()
|
11 |
|
12 | let ignoreOnLinux = ["canary", "beta", "edge"]
|
13 | if (process.platform === "linux" && ignoreOnLinux.includes(shouldBe)) {
|
14 | return
|
15 | }
|
16 |
|
17 | let pth = binaryPath()
|
18 | const { stdout } = await promisify(execFile)(pth, ["--version"])
|
19 |
|
20 | if (stdout.trim().toLowerCase().includes(shouldBe)) {
|
21 | console.log(`Passed: ${pth}`)
|
22 | } else {
|
23 | throw `Couldn't get ${pth} working`
|
24 | }
|
25 | }
|
26 |
|
27 | async function main() {
|
28 | await check(() => getEdgeBetaPath(), "Beta")
|
29 | await check(() => getEdgeCanaryPath(), "Canary")
|
30 | await check(() => getEdgeDevPath(), "Dev")
|
31 | await check(() => getEdgePath(), "Edge")
|
32 | }
|
33 |
|
34 | main().catch((e) => {
|
35 | console.log("Error from main", e)
|
36 |
|
37 | process.exit(1)
|
38 | })
|