Skip to content

Commit

Permalink
fix: enable for Yeoman UI usage
Browse files Browse the repository at this point in the history
  • Loading branch information
petermuessig committed Sep 10, 2022
1 parent b13d1c8 commit 03c2e38
Show file tree
Hide file tree
Showing 3 changed files with 13,099 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# Ignore node_modules
node_modules/

# Ignore test files
!/plugin-generators
/plugin-generators/*
!/plugin-generators/generator-ui5-test

# Ignore PNPM and YARN lock files
pnpm-lock.yaml
yarn.lock
package-lock.json

# Ignore Mac files
.DS_Store
8 changes: 6 additions & 2 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,11 @@ module.exports = class extends Generator {
);

// create the env for the plugin generator
const yeoman = require("yeoman-environment");
const env = yeoman.createEnv(this.args, opts);
let env = this.env; // in case of Yeoman UI the env is injected!
if (!env) {
const yeoman = require("yeoman-environment");
env = yeoman.createEnv(this.args, opts);
}

// helper to derive the subcommand
function deriveSubcommand(namespace) {
Expand Down Expand Up @@ -647,6 +650,7 @@ module.exports = class extends Generator {
env.run(subGenerator, {
verbose: this.options.verbose,
embedded: true,
destinationRoot: this.destinationRoot()
});

} else {
Expand Down
Loading

0 comments on commit 03c2e38

Please sign in to comment.