-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
34 lines (28 loc) · 696 Bytes
/
index.js
File metadata and controls
34 lines (28 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"use strict";
const fs = require("fs");
const os = require("os");
const path = require("path");
const _p = os.platform();
const _a = os.arch();
const platform = _p + "-" + _a;
const SUPPORTED_PLATFORMS = [
"darwin-x64",
"linux-x64",
"linux-arm64",
"linux-arm",
"win32-x64",
];
if (!SUPPORTED_PLATFORMS.includes(platform))
throw "Unsupported platform/architecture: " + platform;
const BIN_DIR = path.join(__dirname, "bin");
const binary = `mediamtx${_p === "win32" ? ".exe" : ""}`;
/**
* @type {{
* path: string;
* version: string;
* }}
*/
module.exports = {
version: fs.readFileSync(path.join(BIN_DIR, "VERSION"), "utf8").trim(),
path: path.join(BIN_DIR, binary),
};