aboutsummaryrefslogtreecommitdiff
path: root/src/cli.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.js')
-rw-r--r--src/cli.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cli.js b/src/cli.js
index 95887f7..affcd9e 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -6,6 +6,7 @@ const events = new Emitter();
const cli = app.commandLine;
const lang = require("./lang");
+const json = require("./modules/json");
function hasArgs() {
// Makes sure the GUI isn't launched.
@@ -38,7 +39,7 @@ function exit(code) {
// gamepath to be able to work.
function gamepathExists() {
if (fs.existsSync("viper.json")) {
- gamepath = JSON.parse(fs.readFileSync("viper.json", "utf8")).gamepath;
+ gamepath = json("viper.json").gamepath;
if (! fs.existsSync(gamepath)) {
console.error(`error: ${lang("cli.gamepath.lost")}`);