Skip to content

Commit fbc7fdd

Browse files
committed
fix(backup): Don't show warnng on current major
refs: TryGhost/Toolbox#334 refs: #468 - Only show the warning about upgrading if there's a major upgrade to do
1 parent c9b2500 commit fbc7fdd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/commands/backup.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ class BackupCommand extends Command {
2323
}
2424

2525
// Get the latest version in our current major
26-
const {latestMajor} = await loadVersions();
26+
const {latestMajor, latest} = await loadVersions();
2727
const activeMajor = semver.major(instance.version);
2828
const latestMinor = latestMajor[`v${activeMajor}`];
2929

30-
if (instance.version !== latestMinor && !argv.force) {
30+
const isBehindByMajor = semver.diff(instance.version, latest) === 'major';
31+
32+
if (instance.version !== latestMinor && isBehindByMajor && !argv.force) {
3133
const currentMajor = semver.major(instance.version);
3234

3335
throw new CliError({

0 commit comments

Comments
 (0)