Skip to content

Commit

Permalink
feat: ensure resolver returns absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinEberhardt committed May 15, 2023
1 parent ff4817a commit 936302e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/generatorResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit 936302e

Please sign in to comment.