From 850ed6502c3ffd5c39561160d487ad83724fd734 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Thu, 29 Sep 2022 02:55:33 +0200 Subject: [PATCH] Fix package.json getting embedded in the release builds (#2635) --- src/renderer/App.js | 4 ++-- src/renderer/views/About/About.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/App.js b/src/renderer/App.js index 2c32ee39..c1e06bcd 100644 --- a/src/renderer/App.js +++ b/src/renderer/App.js @@ -12,6 +12,7 @@ import FtProgressBar from './components/ft-progress-bar/ft-progress-bar.vue' import { marked } from 'marked' import Parser from 'rss-parser' import { IpcChannels } from '../constants' +import packageDetails from '../../package.json' let ipcRenderer = null @@ -195,7 +196,6 @@ export default Vue.extend({ checkForNewUpdates: function () { if (this.checkForUpdates) { - const { version } = require('../../package.json') const requestUrl = 'https://api.github.com/repos/freetubeapp/freetube/releases?per_page=1' fetch(requestUrl) @@ -209,7 +209,7 @@ export default Vue.extend({ const message = this.$t('Version $ is now available! Click for more details') this.updateBannerMessage = message.replace('$', versionNumber) - const appVersion = version.split('.') + const appVersion = packageDetails.version.split('.') const latestVersion = versionNumber.split('.') if (parseInt(appVersion[0]) < parseInt(latestVersion[0])) { diff --git a/src/renderer/views/About/About.js b/src/renderer/views/About/About.js index 62ba3fa8..17cbd4eb 100644 --- a/src/renderer/views/About/About.js +++ b/src/renderer/views/About/About.js @@ -2,8 +2,7 @@ import Vue from 'vue' import FtCard from '../../components/ft-card/ft-card.vue' import FtElementList from '../../components/ft-element-list/ft-element-list.vue' import FtButton from '../../components/ft-button/ft-button.vue' - -const { version } = require('../../../../package.json') +import packageDetails from '../../../../package.json' export default Vue.extend({ name: 'About', @@ -14,7 +13,7 @@ export default Vue.extend({ }, data: function () { return { - versionNumber: `v${version}`, + versionNumber: `v${packageDetails.version}`, chunks: [ { icon: ['fab', 'github'],