Made changes to structure of upgrades.js. Makes it possible in the future to add stuff for a upgrade

namespaces
Pål Jørgensen 2014-08-04 10:49:49 +02:00
parent ebbd4c8fc1
commit d3cd7aced4
1 changed files with 9 additions and 4 deletions

View File

@ -361,10 +361,15 @@ var H5PUpgrades = H5PUpgrades || {};
} }
else { else {
// We found an upgrade hook, run it // We found an upgrade hook, run it
upgrade(params, function (err, upgradedParams) { if (upgrade.contentUpgrade !== undefined && typeof upgrade.contentUpgrade === 'function') {
params = upgradedParams; upgrade.contentUpgrade(params, function (err, upgradedParams) {
nextMinor(err); params = upgradedParams;
}); nextMinor(err);
});
}
else {
nextMinor(info.errorScript.replace('%lib', library.name + ' ' + newVersion));
}
} }
}, nextMajor); }, nextMajor);
} }