yeoman:generator - evanmoran/quick GitHub Wiki
Yeoman Generators are Node modules that start with generator-
.
Search for generators with:
npm search generator-
To create a generator install the generator-generator:
npm install -g generator-generator
Run the generator-generator you just installed:
yo generator
You will write your generator in app/index.js And your this.sourceRoot() will start in app/template
Manipulate Directory Locations:
this.sourceRoot() # Get the source dir
this.sourceRoot(newDir) # Change the source dir
this.destinationRoot() # Get the dest dir
this.destinationRoot(newDir) # Change the dest dir
Copy / Move Files from sourceRoot to destRoot
this.copy('source.txt', 'dest.txt') # Copy
this.template('source.txt', 'dest.txt', data) # Copy and template
this.directory('.','.') # Copy everything in dir