Fix package.json getting embedded in the release builds (#2635)

This commit is contained in:
absidue 2022-09-29 02:55:33 +02:00 committed by GitHub
parent 6ce8c2c48d
commit 850ed6502c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import FtProgressBar from './components/ft-progress-bar/ft-progress-bar.vue'
import { marked } from 'marked' import { marked } from 'marked'
import Parser from 'rss-parser' import Parser from 'rss-parser'
import { IpcChannels } from '../constants' import { IpcChannels } from '../constants'
import packageDetails from '../../package.json'
let ipcRenderer = null let ipcRenderer = null
@ -195,7 +196,6 @@ export default Vue.extend({
checkForNewUpdates: function () { checkForNewUpdates: function () {
if (this.checkForUpdates) { if (this.checkForUpdates) {
const { version } = require('../../package.json')
const requestUrl = 'https://api.github.com/repos/freetubeapp/freetube/releases?per_page=1' const requestUrl = 'https://api.github.com/repos/freetubeapp/freetube/releases?per_page=1'
fetch(requestUrl) fetch(requestUrl)
@ -209,7 +209,7 @@ export default Vue.extend({
const message = this.$t('Version $ is now available! Click for more details') const message = this.$t('Version $ is now available! Click for more details')
this.updateBannerMessage = message.replace('$', versionNumber) this.updateBannerMessage = message.replace('$', versionNumber)
const appVersion = version.split('.') const appVersion = packageDetails.version.split('.')
const latestVersion = versionNumber.split('.') const latestVersion = versionNumber.split('.')
if (parseInt(appVersion[0]) < parseInt(latestVersion[0])) { if (parseInt(appVersion[0]) < parseInt(latestVersion[0])) {

View File

@ -2,8 +2,7 @@ import Vue from 'vue'
import FtCard from '../../components/ft-card/ft-card.vue' import FtCard from '../../components/ft-card/ft-card.vue'
import FtElementList from '../../components/ft-element-list/ft-element-list.vue' import FtElementList from '../../components/ft-element-list/ft-element-list.vue'
import FtButton from '../../components/ft-button/ft-button.vue' import FtButton from '../../components/ft-button/ft-button.vue'
import packageDetails from '../../../../package.json'
const { version } = require('../../../../package.json')
export default Vue.extend({ export default Vue.extend({
name: 'About', name: 'About',
@ -14,7 +13,7 @@ export default Vue.extend({
}, },
data: function () { data: function () {
return { return {
versionNumber: `v${version}`, versionNumber: `v${packageDetails.version}`,
chunks: [ chunks: [
{ {
icon: ['fab', 'github'], icon: ['fab', 'github'],