Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicter from previous environment instantiation is used and not recreated #324

Closed
Himavanth opened this issue Sep 1, 2021 · 2 comments · Fixed by #334
Closed

Conflicter from previous environment instantiation is used and not recreated #324

Himavanth opened this issue Sep 1, 2021 · 2 comments · Fixed by #334
Labels

Comments

@Himavanth
Copy link

Sample code

let env = yeoman.createEnv()
    // first run app generator that will generate the root skeleton
    const appGen = env.instantiate(generators['base-app'], {
      options: {
        'skip-prompt': flags.yes,
        'project-name': projectName
      }
    })
    await env.runGenerator(appGen)

    // Creating new Yeoman env here to workaround an issue where 
    // yeoman reuses the conflicter from previous environment.
    // env = yeoman.createEnv()

      const extGen = env.instantiate(
        extensionPoints[i].generator,
        {
          options: {
            'skip-prompt': flags.yes,
            // do not prompt for overwrites
            force: true
          }
        })
      await env.runGenerator(extGen)

Now, at the last line, extGen should have run with new options which include force but it doesn't because the previous conflicter is used. https://github.com/yeoman/environment/blob/main/lib/environment.js#L1013
I think a new conflicter should be re-created if env is re-instantiated because the force parameter is a part of instantiation options.

@mshima
Copy link
Member

mshima commented Sep 28, 2021

Makes sense.
Maybe the environment can set conflicter to undefined at end event.

@github-actions
Copy link
Contributor

This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants