diff options
author | 0neGal <mail@0negal.com> | 2021-12-31 15:34:56 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2021-12-31 15:34:56 +0100 |
commit | 3c948969bbd203d3e4ab4bd05ce25b4c6277094d (patch) | |
tree | 99878dddd355f262f005e17759bbf048a08d2ed3 /src/index.js | |
parent | c8fec42e085ef255a01f62c5010e2d41bb7eb05f (diff) | |
parent | addc349189f582a1d8a833ba554f7b8df9205dd4 (diff) | |
download | Viper-3c948969bbd203d3e4ab4bd05ce25b4c6277094d.tar.gz Viper-3c948969bbd203d3e4ab4bd05ce25b4c6277094d.zip |
Merge branch 'feat/version-indicator' of https://github.com/Alystrasz/viper into Alystrasz-feat/version-indicator
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/index.js b/src/index.js index c99e367..198bc74 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ const fs = require("fs"); const path = require("path"); -const { app, dialog, ipcMain, BrowserWindow } = require("electron"); +const { app, dialog, ipcMain, BrowserWindow, ipcRenderer } = require("electron"); const Emitter = require("events"); const events = new Emitter(); @@ -17,7 +17,7 @@ function start() { title: "Viper", resizable: false, titleBarStyle: "hidden", - icon: path.join(__dirname, 'assets/icons/512x512.png'), + icon: path.join(__dirname, "assets/icons/512x512.png"), webPreferences: { nodeIntegration: true, contextIsolation: false, @@ -48,7 +48,22 @@ ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)}) ipcMain.on("launchVanilla", (event) => {utils.launch("vanilla")}) ipcMain.on("update", (event) => {utils.update()}) -ipcMain.on("setpathcli", (event) => {utils.setpath()}) +ipcMain.on("setpathcli", (event) => {utils.setpath()}); + +ipcMain.on("getversion", () => { + win.webContents.send("version", { + ns: utils.getNSVersion(), + vp: "v" + require("../package.json").version + }); +}); + +ipcMain.on("versioncli", () => { + console.log("Viper: v" + require("../package.json").version); + console.log("Northstar: " + utils.getNSVersion()); + console.log("Node: " + process.version); + console.log("Electron: v" + process.versions.electron); + cli.exit(); +}) process.chdir(app.getPath("appData")); |