Skip to content

Commit

Permalink
fix(major): allowed auto major upgrades when theme has warnings
Browse files Browse the repository at this point in the history
- currently, we don't allow a no-prompt/auto upgrade of Ghost if the
  theme has warnings
- warnings aren't fatal and we're starting to ship deprecations for v5,
  so CI in Ghost is failing
- this commit ignores warnings during the prompt and updates the
  relevant test
  • Loading branch information
daniellockyer committed Mar 22, 2022
1 parent fbe7a2d commit 7ad1f93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/tasks/major-update/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module.exports = async function ui(ctx) {
});
}

const autoUpgradeDefault = (!results.error.all.length && !results.warning.all.length);
const autoUpgradeDefault = !results.error.all.length;
const answer = await ctx.ui.confirm(`Are you sure you want to proceed with migrating to Ghost ${ctx.version}?`, autoUpgradeDefault, {prefix: chalk.cyan('?')});
if (!answer) {
throw new CliError({
Expand Down
2 changes: 1 addition & 1 deletion test/unit/tasks/major-update/ui-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Unit: Tasks > Major Update > UI', function () {
await ui(ctx);
expect(ctx.ui.log.callCount).to.eql(7);
expect(ctx.ui.confirm.calledTwice).to.be.true;
expect(ctx.ui.confirm.args[1][1], 'confirm prompt default should be false').to.be.false;
expect(ctx.ui.confirm.args[1][1], 'confirm prompt default should be false').to.be.true;

const output = stripAnsi(ctx.ui.log.args.join(' '));

Expand Down

0 comments on commit 7ad1f93

Please sign in to comment.