Skip to content

Commit 93d191f

Browse files
kirrg001acburdine
authored andcommitted
fix(v2): ensure migrate script validates Casper correctly
refs #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
1 parent d243bed commit 93d191f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/tasks/major-update/data.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function getData(options = {}) {
2424

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

27-
const themeFolder = path.resolve(options.dir, 'content', 'themes');
27+
let themeFolder = path.resolve(options.dir, 'content', 'themes');
2828
let gscanReport;
2929

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

40+
// CASE: use casper from v2 folder, otherwise we are validating the old casper
41+
if (activeTheme === 'casper') {
42+
themeFolder = path.resolve(options.dir, options.version, 'content', 'themes');
43+
}
44+
4045
return gscan.check(path.resolve(themeFolder, activeTheme));
4146
})
4247
.then((report) => {

0 commit comments

Comments
 (0)