diff options
author | 0neGal <mail@0negal.com> | 2023-03-05 22:43:09 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-03-05 22:43:09 +0100 |
commit | 7ef891c54e0e9b06efc09e0d5e328d900a31e958 (patch) | |
tree | 00cc2d7fe48dd558421f17a95002ad5d59a6e3f8 /src/modules/launch.js | |
parent | cf61a55b1e490befa976d4240593b535777caf69 (diff) | |
download | Viper-7ef891c54e0e9b06efc09e0d5e328d900a31e958.tar.gz Viper-7ef891c54e0e9b06efc09e0d5e328d900a31e958.zip |
small cleanups and changes in comments
I've made some code return early instead of adding more nesting, on top
of this I've added some more comments in some files, rephrased a few
things, and so on...
Diffstat (limited to 'src/modules/launch.js')
-rw-r--r-- | src/modules/launch.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/launch.js b/src/modules/launch.js index 765c348..82de109 100644 --- a/src/modules/launch.js +++ b/src/modules/launch.js @@ -6,11 +6,12 @@ const lang = require("../lang"); const win = require("./window"); const settings = require("./settings"); -// Launches the game +// launches the game // -// Either Northstar or Vanilla. Linux support is not currently a thing, +// either Northstar or Vanilla. Linux support is not currently a thing, // however it'll be added at some point. function launch(game_version) { + // return early, and show error message if on Linux if (process.platform == "linux") { win.alert(lang("cli.launch.linuxerror")); console.error("error:", lang("cli.launch.linuxerror")); @@ -18,7 +19,10 @@ function launch(game_version) { return; } + // change current directory to gamepath process.chdir(settings.gamepath); + + // launch the requested game version switch(game_version) { case "vanilla": console.log(lang("general.launching"), "Vanilla..."); |