Permalink
Browse files

Merge pull request #477 from robdodson/initializer-fix

Fix initializer example
  • Loading branch information...
2 parents c3660c1 + 1268b23 commit 2c709116990d7745a800ef2e4132a6df84f0a414 @addyosmani addyosmani committed Sep 16, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 docs/cli/generators.md
@@ -221,7 +221,7 @@ lib/generators/initializer/templates/initializer.js with the following content:
And now let’s change the generator to copy this template when invoked:
var util = require('util'),
- yeoman = require('../../../');
+ yeoman = require('yeoman');
module.exports = Generator;
@@ -233,12 +233,12 @@ And now let’s change the generator to copy this template when invoked:
util.inherits(Generator, yeoman.generatos.NamedBase);
Generator.prototype.copyInitializerFile = function() {
- this.copy('initializer.js', 'config/initializers/' + name + '.js');
+ this.copy('initializer.js', 'config/initializers/' + this.name + '.js');
};
And let’s execute our generator:
- $ yeoman generate initializer core_extensions
+ $ yeoman init initializer core_extensions
We can see that now an initializer named `core_extensions` was created at
`config/initializers/core_extensions.js` with the contents of our template. That
@@ -249,7 +249,7 @@ we gave. The property `name` is automatically created when we inherit from
### Generators Lookup
-When you run `yeoman generate initializer core_extensions` yeoman requires these
+When you run `yeoman init initializer core_extensions` yeoman requires these
paths in turn until one is found:
lib/generators/initializer/index.js

0 comments on commit 2c70911

Please sign in to comment.