1

I have a Yeoman Generator (that I maintain) that scaffolds Node.js sites. Each site then gets customized. During the customization process I'll find some functionality that I've added to one of the sites (A) that I want to use in the site that I'm currently customizing (B) and that should also go back into the generator in case other sites will need it.

To keep the question simple let's imagine that I added a single module and associated test to Site A that is needed in Site B.

What I can do is manually copy/paste the files from Site A to the generator and then also to Site B.

I'm okay with the manual addition of the files from Site A to the generator. What I'd like to find is an automated way to solve a one-way-missing files from the generator to a previously generated site. i.e. Is there a way with Yeoman to be able to retroactively add files that are new to the generator?

Guy
  • 65,082
  • 97
  • 254
  • 325

1 Answers1

3

You can update your Yeoman generator with the new additions from Site A and then run again your Yeoman generator in Site B. Yeoman will ask what to do with existing files, so you can keep them or see the differences.

Check out this answer for more info: How to upgrade existing project scaffolded with Yeoman.

Community
  • 1
  • 1
dgil
  • 2,318
  • 2
  • 23
  • 39