Skip to content

Commit

Permalink
fix: more detailed theme variation error
Browse files Browse the repository at this point in the history
  • Loading branch information
martinchuka committed Jan 4, 2020
1 parent 4dd01ab commit 96e3a30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/stencil-push.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,9 @@ utils.getVariations = (options, callback) => {
};
if (options.activate !== true && options.activate !== undefined) {
const findVariation = result.variations.find(item => item.name === options.activate);
if (!findVariation || !findVariation.uuid) {
throw new Error(`Invalid theme variation provided!. Available options${result.variations.map(item => ` ${item.name}`).join(',')}...`);
}
callback(null, Object.assign({}, options, { variationId: findVariation.uuid }));
} else if (options.activate === true) {
callback(null, Object.assign({}, options, { variationId: result.variations[0].uuid }));
Expand Down

0 comments on commit 96e3a30

Please sign in to comment.