Skip to content

Commit

Permalink
remove sudo requirement when launching on the CLI under Linux syste…
Browse files Browse the repository at this point in the history
…ms (#425)

* Update MemoryUtil.hx

* move comment

* Remove random whitespace

* I kinda broke mac there
  • Loading branch information
crowplexus authored Nov 3, 2024
1 parent 0261223 commit da3fd5e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/funkin/backend/utils/MemoryUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,16 @@ class MemoryUtil {
reg.match(process.stdout.readAll().toString());
if (process.exitCode() == 0) return reg.matched(1);
#elseif linux
var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]);
/*var process = new HiddenProcess("sudo", ["dmidecode", "--type", "17"]);
if (process.exitCode() != 0) return "Unknown";
var lines = process.stdout.readAll().toString().split("\n");
for (line in lines) {
if (line.indexOf("Type:") == 0) {
return line.substring("Type:".length).trim();
}
}
}*/
// TODO: sort of unsafe? also requires users to use `sudo`
// when launching the engine through the CLI, REIMPLEMENT LATER.
#end
return "Unknown";
}
Expand Down

0 comments on commit da3fd5e

Please sign in to comment.