diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2023-04-19 10:26:33 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2023-04-19 13:37:31 +0200 |
| commit | f1cd70e224890635eb74f7a9b799cd8d43d3320d (patch) | |
| tree | 67991c7d42edff5238ec2bf2e223a79db0081152 /gui | |
| parent | a40097cb5bcbc8b85d8bb23f6b2f32b6fab7a5ff (diff) | |
| download | mullvadvpn-f1cd70e224890635eb74f7a9b799cd8d43d3320d.tar.xz mullvadvpn-f1cd70e224890635eb74f7a9b799cd8d43d3320d.zip | |
Add command line version option
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/main/command-line-options.ts | 1 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 7 | ||||
| -rw-r--r-- | gui/src/main/version.ts | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/gui/src/main/command-line-options.ts b/gui/src/main/command-line-options.ts index 01cf2ae331..0cddf6b14a 100644 --- a/gui/src/main/command-line-options.ts +++ b/gui/src/main/command-line-options.ts @@ -26,6 +26,7 @@ class DevelopmentCommandLineOption extends CommandLineOption { export const CommandLineOptions = { help: new CommandLineOption('Print this help text', '--help', '-h'), + version: new CommandLineOption('Print the app version', '--version'), showChanges: new CommandLineOption('Show changes dialog', '--show-changes'), disableResetNavigation: new DevelopmentCommandLineOption('--disable-reset-navigation'), disableDevtoolsOpen: new DevelopmentCommandLineOption('--disable-devtools-open'), diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 613d1a92e9..484f4db4b3 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -60,7 +60,7 @@ import TunnelStateHandler, { TunnelStateProvider, } from './tunnel-state'; import UserInterface, { UserInterfaceDelegate } from './user-interface'; -import Version from './version'; +import Version, { GUI_VERSION } from './version'; const execAsync = util.promisify(exec); @@ -1057,6 +1057,11 @@ if (CommandLineOptions.help.match) { printElectronOptions(); process.exit(0); +} else if (CommandLineOptions.version.match) { + console.log(GUI_VERSION); + console.log('Electron version:', process.versions.electron); + + process.exit(0); } else { const applicationMain = new ApplicationMain(); applicationMain.run(); diff --git a/gui/src/main/version.ts b/gui/src/main/version.ts index fbe5b64574..1bab7728b4 100644 --- a/gui/src/main/version.ts +++ b/gui/src/main/version.ts @@ -13,7 +13,7 @@ import { DaemonRpc } from './daemon-rpc'; import { IpcMainEventChannel } from './ipc-event-channel'; import { NotificationSender } from './notification-controller'; -const GUI_VERSION = app.getVersion().replace('.0', ''); +export const GUI_VERSION = app.getVersion().replace('.0', ''); /// Mirrors the beta check regex in the daemon. Matches only well formed beta versions const IS_BETA = /^(\d{4})\.(\d+)-beta(\d+)$/; |
