Skip to content

Commit

Permalink
Update cli/environment-builder.js
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored and emilpaw committed Sep 15, 2022
1 parent 93e604a commit 931bc39
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cli/environment-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,17 @@ module.exports = class EnvironmentBuilder {
*/
_lookupJHipster() {
// Register jhipster generators.
this.env.lookup({ packagePaths: [path.join(__dirname, '../..')], lookups: ['dist/generators'] }).forEach(generator => {
const sourceRoot = path.basename(path.join(__dirname, '..'));
let packagePath;
let lookup;
if (sourceRoot === 'generator-jhipster') {
packagePath = path.join(__dirname, '..');
lookup = 'generators';
} else {
packagePath = path.join(__dirname, '../..');
lookup = `${sourceRoot}/generators`;
}
this.env.lookup({ packagePaths: [packagePath], lookups: [lookup] }).forEach(generator => {
// Verify jhipster generators namespace.
assert(
generator.namespace.startsWith(`${CLI_NAME}:`),
Expand Down

0 comments on commit 931bc39

Please sign in to comment.