Potential fix for code scanning alert no. 6: Unnecessary use of cat process (#473)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Emrik Östling 2025-12-14 20:32:56 +01:00 committed by GitHub
parent af199ab8bb
commit 4598745956
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,11 @@
import { exec } from "node:child_process"; import { exec } from "node:child_process";
import { readFile } from "node:fs";
import { version } from "../../package.json"; import { version } from "../../package.json";
console.log(`ConvertX v${version}`); console.log(`ConvertX v${version}`);
if (process.env.NODE_ENV === "production") { if (process.env.NODE_ENV === "production") {
exec("cat /etc/os-release", (error, stdout) => { readFile("/etc/os-release", "utf8", (error, stdout) => {
if (error) { if (error) {
console.error("Not running on docker, this is not supported."); console.error("Not running on docker, this is not supported.");
} }