UNPKG

1.07 kBJavaScriptView Raw
1let { getEdgeBetaPath, getEdgeCanaryPath, getEdgeDevPath, getEdgePath } = require("..")
2
3let { execFile } = require("child_process")
4const { promisify } = require("util")
5
6// Todo when canary beta are released remove ignoredOnLinux
7// variable. And don't forget to update src/main.ts
8
9async 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
27async function main() {
28 await check(() => getEdgeBetaPath(), "Beta")
29 await check(() => getEdgeCanaryPath(), "Canary")
30 await check(() => getEdgeDevPath(), "Dev")
31 await check(() => getEdgePath(), "Edge")
32}
33
34main().catch((e) => {
35 console.log("Error from main", e)
36 // Exit so ci can notice?
37 process.exit(1)
38})