aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-11 20:06:41 +0100
committer0neGal <mail@0negal.com>2022-01-11 20:06:41 +0100
commit84c62584f03126bf23b5c2899e05359d7bfc4471 (patch)
tree860d7ef63238a9355c42b17d01d68e2c8efa2b4c /src/utils.js
parentfe6dd267136f09bab721d3f02d43b991ac2bad3d (diff)
downloadViper-84c62584f03126bf23b5c2899e05359d7bfc4471.tar.gz
Viper-84c62584f03126bf23b5c2899e05359d7bfc4471.zip
formatting, and localized logs
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/utils.js b/src/utils.js
index 95e54e0..87499ae 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -36,7 +36,7 @@ if (fs.existsSync("viper.json")) {
}
-async function _isGameRunning() {
+async function isGameRunning() {
return new Promise(resolve => {
let procs = ["Titanfall2.exe", "Titanfall2-unpacked.exe", "NorthstarLauncher.exe"];
let cmd = (() => {
@@ -60,28 +60,29 @@ async function _isGameRunning() {
}
northstar_auto_updates: {
- if (!settings.autoupdate || !fs.existsSync("viper.json") || settings.gamepath.length === 0)
+ if (!settings.autoupdate || !fs.existsSync("viper.json") || settings.gamepath.length === 0) {
break northstar_auto_updates;
+ }
async function _checkForUpdates() {
- const localVersion = getNSVersion();
- const distantVersion = await requests.getLatestNsVersion();
- console.log('Checking for Northstar updates...');
+ let localVersion = getNSVersion();
+ let distantVersion = await requests.getLatestNsVersion();
+ console.log(lang("cli.autoupdates.checking"));
if (localVersion !== distantVersion) {
- console.log('Northstar update available!');
- if (await _isGameRunning()) {
- console.log('Not installing update since game is running.');
+ console.log(lang("cli.autoupdates.available"));
+ if (await isGameRunning()) {
+ console.log(lang("cli.autoupdates.gamerunning"));
new Notification({
title: lang("gui.nsupdate.gaming.title"),
body: lang("gui.nsupdate.gaming.body")
}).show();
} else {
- console.log('Launching update process.');
+ console.log(lang("cli.autoupdates.updatingns"));
update();
}
} else {
- console.log('No Northstar update available.')
+ console.log(lang("cli.autoupdates.noupdate"))
}
setTimeout(
@@ -486,6 +487,7 @@ module.exports = {
updatevp,
settings,
getNSVersion,
+ isGameRunning,
setlang: (lang) => {
settings.lang = lang;
saveSettings();