Added automatic app versioning system

This commit is contained in:
RemixDev
2021-07-18 21:59:41 +02:00
parent 74fcaa625c
commit 4604f2176e
6 changed files with 22 additions and 17 deletions

View File

@@ -2,3 +2,4 @@ import path from 'path'
export const ROOT_DIR = path.resolve(path.join(__dirname, '..', '..'))
export const WEBUI_DIR = path.join(ROOT_DIR, 'webui', 'public')
export const GUI_PACKAGE = path.join(ROOT_DIR, 'package.json')

View File

@@ -1,6 +1,8 @@
import fs from 'fs'
import express from 'express'
// @ts-expect-error
import { Deezer } from 'deezer-js'
import { GUI_PACKAGE } from '../helpers/paths'
import { sessionDZ, getQueue, deemixVersion, isDeezerAvailable } from '../main'
const router = express.Router()
@@ -11,9 +13,11 @@ router.get('/connect', async (req, res) => {
const dz = sessionDZ[req.session.id]
if (!update) {
const currentVersion = JSON.parse(String(fs.readFileSync(GUI_PACKAGE))).version
console.log(currentVersion)
update = {
currentCommit: 'testing',
latestCommit: 'testing',
currentCommit: currentVersion === '0.0.0' ? 'continuous' : currentVersion,
latestCommit: null,
updateAvailable: false,
deemixVersion
}