From d67056627021c89915863ba173102bdb658f749a Mon Sep 17 00:00:00 2001 From: addyosmani Date: Fri, 31 Aug 2012 14:19:32 +0100 Subject: [PATCH] Fix for #190 - documenting warnOn. --- docs/cli/generators.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/cli/generators.md b/docs/cli/generators.md index b2e13f5f..8ea285fe 100644 --- a/docs/cli/generators.md +++ b/docs/cli/generators.md @@ -342,9 +342,6 @@ layout by just creating edit.html.erb, index.html.erb and so on inside lib/templates/erb/scaffold. - - - ### More On Generators So we know that a typical generator looks like the following: @@ -740,6 +737,13 @@ directory. #### remote.template(source, destination, options) -Same as `generator.directory()` but relative `source` is prefixed with the cache -directory. +Same as `generator.directory()` but relative `source` is prefixed with the cache directory. + + +#### Prompt user before overwriting files with `--force` + +Generators also support a `warnOn` method, which allows developers to warn on global paths that are matching those paths or files which the generator is going to generate (e.g `self.warnOn('*')`. + +Where used, Yeoman will warn the user they if they proceed that a file will be overwritten and they may need to call the generator with the `--force` flag to proceed. +`warnOn` is most likely to be used in constructors.