From dde767280873270be6ab40ff91df113291ab4a50 Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Mon, 8 Jan 2024 11:12:20 -0500 Subject: [PATCH] fix getting version from cli arg with yargs after the Electron 28 bump (#1058) * fix getting version from cli arg with yargs after the Electron 28 bump * bump version to 1.4.2 --- app/appConfiguration/index.js | 4 ++-- app/config/index.js | 3 ++- app/index.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/appConfiguration/index.js b/app/appConfiguration/index.js index d4a8638d..5e714017 100644 --- a/app/appConfiguration/index.js +++ b/app/appConfiguration/index.js @@ -9,9 +9,9 @@ class AppConfiguration { /** * @param {string} configPath */ - constructor(configPath) { + constructor(configPath, appVersion) { _AppConfiguration_configPath.set(this, configPath); - _AppConfiguration_startupConfig.set(this, require('../config')(configPath)); + _AppConfiguration_startupConfig.set(this, require('../config')(configPath, appVersion)); _AppConfiguration_legacyConfigStore.set(this, new Store({ name: 'config' })); diff --git a/app/config/index.js b/app/config/index.js index 1cb8ed66..9a65ebd7 100644 --- a/app/config/index.js +++ b/app/config/index.js @@ -12,13 +12,14 @@ function getConfigFile(configPath) { } } -function argv(configPath) { +function argv(configPath, appVersion) { let configFile = getConfigFile(configPath); const missingConfig = configFile == null; configFile = configFile || {}; let config = yargs .env(true) .config(configFile) + .version(appVersion) .options({ appActiveCheckInterval: { default: 2, diff --git a/app/index.js b/app/index.js index 89abc5bf..1ededd5a 100644 --- a/app/index.js +++ b/app/index.js @@ -12,7 +12,7 @@ if (app.commandLine.hasSwitch('customUserDir')) { } const { AppConfiguration } = require('./appConfiguration'); -const appConfig = new AppConfiguration(app.getPath('userData')); +const appConfig = new AppConfiguration(app.getPath('userData'), app.getVersion()); const config = appConfig.startupConfig; config.appPath = path.join(__dirname, isDev ? '' : '../../'); diff --git a/package.json b/package.json index 47c8a0e1..20491ec7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teams-for-linux", - "version": "1.4.1", + "version": "1.4.2", "main": "app/index.js", "description": "Unofficial client for Microsoft Teams for Linux", "homepage": "https://github.com/IsmaelMartinez/teams-for-linux",