media2ascii 1.0.3 → 1.2.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.
@@ -7,15 +7,20 @@ const os = require("os");
7
7
  const platform = os.platform();
8
8
  const arch = os.arch();
9
9
 
10
- let bin;
11
- if (platform === "darwin" && arch === "arm64") {
12
- bin = path.join(__dirname, "media2ascii_darwin_arm64");
13
- } else if (platform === "darwin") {
14
- bin = path.join(__dirname, "media2ascii_darwin_amd64");
15
- } else {
10
+ const BINARIES = {
11
+ darwin: { arm64: "media2ascii_darwin_arm64", x64: "media2ascii_darwin_amd64" },
12
+ linux: { arm64: "media2ascii_linux_arm64", x64: "media2ascii_linux_amd64", arm: "media2ascii_linux_arm" },
13
+ win32: { arm64: "media2ascii_windows_arm64.exe", x64: "media2ascii_windows_amd64.exe" },
14
+ freebsd: { x64: "media2ascii_freebsd_amd64" },
15
+ };
16
+
17
+ const platformBins = BINARIES[platform];
18
+ const binName = platformBins && (platformBins[arch] || platformBins["x64"]);
19
+ if (!binName) {
16
20
  console.error("Plataforma não suportada: " + platform + "/" + arch);
17
21
  process.exit(1);
18
22
  }
23
+ const bin = path.join(__dirname, binName);
19
24
 
20
25
  // Add ffmpeg-static to PATH so the Go binary can find ffmpeg
21
26
  const ffmpegPath = require("ffmpeg-static");
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "media2ascii",
3
- "version": "1.0.3",
3
+ "version": "1.2.0",
4
4
  "description": "Converta imagens e vídeos em arte ASCII no terminal",
5
5
  "bin": {
6
6
  "media2ascii": "./bin/media2ascii.js"