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:
parent
af199ab8bb
commit
4598745956
1 changed files with 2 additions and 1 deletions
|
|
@ -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.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue