Skip to content

Commit

Permalink
fix nsargs being cleared when edited out of Viper (#93)
Browse files Browse the repository at this point in the history
If the nsargs are edited by a third-party program or anything that isn't
Viper, the next time you launch Viper it'll reset the nsargs back to
what it was when you last opened it.
  • Loading branch information
0neGal authored Mar 10, 2022
1 parent 6da9e22 commit 0cae81f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ if (fs.existsSync("viper.json")) {
} else {
setpath(true);
}

let args = path.join(settings.gamepath, "ns_startup_args.txt");
if (fs.existsSync(args)) {
settings.nsargs = fs.readFileSync(args, "utf8");
}
} else {
setpath();
}
Expand Down
5 changes: 5 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ var settings = {
if (fs.existsSync("viper.json")) {
settings = {...settings, ...JSON.parse(fs.readFileSync("viper.json", "utf8"))};
settings.zip = path.join(settings.gamepath + "/northstar.zip");

let args = path.join(settings.gamepath, "ns_startup_args.txt");
if (fs.existsSync(args)) {
settings.nsargs = fs.readFileSync(args, "utf8");
}
} else {
console.log(lang("general.missingpath"));
}
Expand Down

0 comments on commit 0cae81f

Please sign in to comment.