Skip to content

Commit

Permalink
fix(v2): changed major update task: validate Casper theme from correc…
Browse files Browse the repository at this point in the history
…t folder

refs TryGhost#759
- if your active theme is "casper", we have to validate the casper theme from the v2 folder
- otherwise we will validate casper from Ghost v1 with GScan v2
  • Loading branch information
kirrg001 authored and acburdine committed Aug 16, 2018
1 parent c4b9e07 commit baa04f7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tasks/major-update/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function getData(options = {}) {

const connection = knex(Object.assign({useNullAsDefault: true}, options.database));

const themeFolder = path.resolve(options.dir, 'content', 'themes');
let themeFolder = path.resolve(options.dir, 'content', 'themes');
let gscanReport;

return connection.raw('SELECT * FROM settings WHERE `key`="active_theme";')
Expand All @@ -37,6 +37,11 @@ module.exports = function getData(options = {}) {
activeTheme = response[0].value;
}

// CASE: use casper from v2 folder, otherwise we are validating the old casper
if (activeTheme === 'casper') {
themeFolder = path.resolve(options.dir, options.version, 'content', 'themes');
}

return gscan.check(path.resolve(themeFolder, activeTheme));
})
.then((report) => {
Expand Down

0 comments on commit baa04f7

Please sign in to comment.