2024-06-28 00:05:21 +02:00
|
|
|
import { exec } from "node:child_process";
|
|
|
|
|
import { version } from "../../package.json";
|
2025-02-18 20:05:46 +01:00
|
|
|
|
2024-06-28 00:05:21 +02:00
|
|
|
console.log(`ConvertX v${version}`);
|
|
|
|
|
|
|
|
|
|
if (process.env.NODE_ENV === "production") {
|
|
|
|
|
exec("cat /etc/os-release", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Not running on docker, this is not supported.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split('PRETTY_NAME="')[1]?.split('"')[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("pandoc -v", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Pandoc is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("ffmpeg -version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("FFmpeg is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("vips -v", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Vips is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-05-23 21:18:47 +02:00
|
|
|
exec("magick --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("ImageMagick is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]?.replace("Version: ", ""));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-28 00:05:21 +02:00
|
|
|
exec("gm version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("GraphicsMagick is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-16 11:34:47 +01:00
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("inkscape --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Inkscape is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-28 00:05:21 +02:00
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("djxl --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("libjxl-tools is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
exec("xelatex -version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Tex Live with XeTeX is not installed.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-07-30 00:48:15 +02:00
|
|
|
|
2024-08-23 19:14:06 +02:00
|
|
|
exec("resvg -V", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("resvg is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(`resvg v${stdout.split("\n")[0]}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-09-26 08:23:28 -04:00
|
|
|
exec("assimp version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("assimp is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
2025-02-01 21:08:04 +01:00
|
|
|
console.log(`assimp ${stdout.split("\n")[5]}`);
|
2024-09-26 08:23:28 -04:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-12-07 02:38:30 +01:00
|
|
|
exec("ebook-convert --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("ebook-convert (calibre) is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-02-18 20:05:46 +01:00
|
|
|
exec("heif-info -v", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("libheif is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(`libheif v${stdout.split("\n")[0]}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-05-05 21:03:53 -05:00
|
|
|
exec("potrace -v", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("potrace is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-06-26 04:01:47 +02:00
|
|
|
exec("soffice --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("libreoffice is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-07-24 20:58:53 +05:30
|
|
|
exec("msgconvert --version", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("msgconvert (libemail-outlook-message-perl) is not installed");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(stdout.split("\n")[0]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-07-30 00:48:15 +02:00
|
|
|
exec("bun -v", (error, stdout) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
console.error("Bun is not installed. wait what");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stdout) {
|
|
|
|
|
console.log(`Bun v${stdout.split("\n")[0]}`);
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-06-28 00:05:21 +02:00
|
|
|
}
|