mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Prevent update downgrade from stable
This commit is contained in:
parent
d79417a4e4
commit
4af2a537ef
2 changed files with 9 additions and 6 deletions
|
@ -110,7 +110,7 @@ module.exports = {
|
|||
const exePath = `./out/${APPLICATION_NAME}-${packageResults.platform}-${packageResults.arch}/${APPLICATION_NAME}.exe`;
|
||||
|
||||
if (fs.existsSync(CI_SIGNING_DIR)) {
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${exePath}`)));
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${exePath}`)).toString().trim());
|
||||
}
|
||||
else {
|
||||
console.warn('Windows signing script not found, skipping...');
|
||||
|
@ -163,7 +163,7 @@ module.exports = {
|
|||
fs.renameSync(`./out/make/wix/${e.arch}/${artifactName}`, artifactPath);
|
||||
|
||||
if (fs.existsSync(CI_SIGNING_DIR)) {
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${artifactPath}`)));
|
||||
console.log(cp.execSync(path.join(CI_SIGNING_DIR, `sign.sh ${artifactPath}`)).toString().trim());
|
||||
}
|
||||
else {
|
||||
console.warn('Windows signing script not found, skipping...');
|
||||
|
@ -182,8 +182,8 @@ module.exports = {
|
|||
console.log(`Making a zip distributable for ${e.platform}/${e.arch}`);
|
||||
const zipPath = path.resolve(process.cwd(), 'out', 'make', 'zip', e.platform, e.arch, generateArtifactName(e.packageJSON, e.platform, e.arch, 'zip'));
|
||||
|
||||
console.log(cp.execSync(`mkdir -p ${path.dirname(zipPath)}`));
|
||||
console.log(cp.execSync(`cd out/${APPLICATION_NAME}-${e.platform}-${e.arch}; zip -r -y "${zipPath}" "${APPLICATION_TITLE}.app"`));
|
||||
console.log(cp.execSync(`mkdir -p ${path.dirname(zipPath)}`).toString().trim());
|
||||
console.log(cp.execSync(`cd out/${APPLICATION_NAME}-${e.platform}-${e.arch}; zip -r -y "${zipPath}" "${APPLICATION_TITLE}.app"`).toString().trim());
|
||||
break;
|
||||
}
|
||||
case "linux": {
|
||||
|
|
|
@ -326,7 +326,7 @@ export class Updater {
|
|||
const localChannelVersion: number = Updater.localPackageJson.channelVersion ? Updater.localPackageJson.channelVersion : 0;
|
||||
const currentChannelVersion: number = Updater.releasesJson.channelCurrentVersions[Updater.updateChannel] ? Updater.releasesJson.channelCurrentVersions[Updater.updateChannel] : 0;
|
||||
logger.info('Update check', {
|
||||
channel: Updater.updateChannel,
|
||||
updateChannel: Updater.updateChannel,
|
||||
channel_version: localChannelVersion,
|
||||
localVersion: Updater.localPackageJson.version,
|
||||
currentVersion: Updater.releasesJson.currentVersion,
|
||||
|
@ -340,7 +340,10 @@ export class Updater {
|
|||
// Allow for update promotion to stable, while still getting updates from the subscribed channel
|
||||
const newCommit = (Updater.updateChannel !== 'stable' && Updater.localPackageJson.commit !== Updater.releasesJson.currentCommit);
|
||||
|
||||
if (newVersion || newChannelVersion || newCommit) {
|
||||
// Prevent downgrading to sub channel if on stable
|
||||
const isDowngrade = Updater.releaseChannel === 'stable' && newChannelVersion;
|
||||
|
||||
if ((newVersion || newChannelVersion || newCommit) && !isDowngrade) {
|
||||
logger.info('Update available...');
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue