mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-18 21:32:50 +00:00
Allow for channel update to stable
This commit is contained in:
parent
fad2c2bfa2
commit
a2ded729d1
4 changed files with 33 additions and 4 deletions
|
@ -95,7 +95,13 @@ export default class Main {
|
|||
{
|
||||
label: 'About',
|
||||
click: async () => {
|
||||
let aboutMessage = `Version: ${Main.application.getVersion()}\nRelease channel: ${Updater.releaseChannel}\n`;
|
||||
let aboutMessage = `Version: ${Main.application.getVersion()}\n`;
|
||||
|
||||
if (Updater.getCommit()) {
|
||||
aboutMessage += `Commit: ${Updater.getCommit()}\n`;
|
||||
}
|
||||
|
||||
aboutMessage += `Release channel: ${Updater.releaseChannel}\n`;
|
||||
|
||||
if (Updater.releaseChannel !== 'stable') {
|
||||
aboutMessage += `Release channel version: ${Updater.getChannelVersion()}\n`;
|
||||
|
@ -446,6 +452,7 @@ export default class Main {
|
|||
Main.logger = log4js.getLogger();
|
||||
Main.logger.info(`Starting application: ${app.name} | ${app.getAppPath()}`);
|
||||
Main.logger.info(`Version: ${app.getVersion()}`);
|
||||
Main.logger.info(`Commit: ${Updater.getCommit()}`);
|
||||
Main.logger.info(`Release channel: ${Updater.releaseChannel} - ${Updater.getChannelVersion()}`);
|
||||
Main.logger.info(`OS: ${process.platform} ${process.arch}`);
|
||||
|
||||
|
|
|
@ -241,6 +241,11 @@ export class Updater {
|
|||
return Updater.localPackageJson.channelVersion;
|
||||
}
|
||||
|
||||
public static getCommit(): string {
|
||||
Updater.localPackageJson.commit = Updater.localPackageJson.commit ? Updater.localPackageJson.commit : null
|
||||
return Updater.localPackageJson.commit;
|
||||
}
|
||||
|
||||
public static async processUpdate(): Promise<void> {
|
||||
try {
|
||||
const updateInfo: UpdateInfo = JSON.parse(fs.readFileSync(Updater.updateMetadataPath, 'utf8'));
|
||||
|
@ -319,10 +324,22 @@ export class Updater {
|
|||
|
||||
const localChannelVersion: number = Updater.localPackageJson.channelVersion ? Updater.localPackageJson.channelVersion : 0;
|
||||
const currentChannelVersion: number = Updater.releasesJson.channelCurrentVersions[Updater.localPackageJson.channel] ? Updater.releasesJson.channelCurrentVersions[Updater.localPackageJson.channel] : 0;
|
||||
logger.info('Update check', { channel: Updater.localPackageJson.channel, channel_version: localChannelVersion, localVersion: Updater.localPackageJson.version,
|
||||
currentVersion: Updater.releasesJson.currentVersion, currentChannelVersion: currentChannelVersion });
|
||||
logger.info('Update check', {
|
||||
channel: Updater.localPackageJson.channel,
|
||||
channel_version: localChannelVersion,
|
||||
localVersion: Updater.localPackageJson.version,
|
||||
currentVersion: Updater.releasesJson.currentVersion,
|
||||
currentCommit: Updater.releasesJson.currentCommit,
|
||||
currentChannelVersion: currentChannelVersion
|
||||
});
|
||||
|
||||
if (Updater.localPackageJson.version !== Updater.releasesJson.currentVersion || (Updater.localPackageJson.channel !== 'stable' && localChannelVersion < currentChannelVersion)) {
|
||||
const newVersion = Updater.localPackageJson.version !== Updater.releasesJson.currentVersion;
|
||||
const newChannelVersion = (Updater.localPackageJson.channel !== 'stable' && localChannelVersion < currentChannelVersion);
|
||||
|
||||
// Allow for update promotion to stable, while still getting updates from the subscribed channel
|
||||
const newCommit = (Updater.localPackageJson.channel !== 'stable' && Updater.localPackageJson.commit !== Updater.releasesJson.currentCommit);
|
||||
|
||||
if (newVersion || newChannelVersion || newCommit) {
|
||||
logger.info('Update available...');
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue