diff --git a/src/common/generatorResolver.js b/src/common/generatorResolver.js index f1b9e2d..27b3663 100644 --- a/src/common/generatorResolver.js +++ b/src/common/generatorResolver.js @@ -64,4 +64,12 @@ function getGenerator(generatorPathOrUrl) { }; } -module.exports = { getGenerator }; +function resolveAndValidate(generatorPathOrUrl) { + const generator = getGenerator(generatorPathOrUrl); + // ensure paths are absolute, and validate contents + generator.path = path.resolve(generator.path); + validateGenerator(generator.path); + return generator; +} + +module.exports = { getGenerator: resolveAndValidate };