From ccca28fbf67caf12885b38cbec4a5d20a458b1cc Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Thu, 19 Dec 2013 18:32:45 -0500 Subject: [PATCH] move after function down the chain, add remove utility fn --- lib/api/init.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/api/init.coffee b/lib/api/init.coffee index e822e7d..b348001 100644 --- a/lib/api/init.coffee +++ b/lib/api/init.coffee @@ -19,12 +19,17 @@ class Init extends Base .then(get_user_config.bind(@)) .then(user_before_fn.bind(@)) .then(prompt_for_info.bind(@)) - .then(user_after_fn.bind(@)) .then(update_template.bind(@)) .then(copy_template.bind(@)) .then(replace_ejs.bind(@)) + .then(user_after_fn.bind(@)) .yield("project #{@template} created!") + # intended for use in the after function, quick way to remove + # files/folders that users wanted to nix after the prompts. + remove: (f) -> + fs.unlinkSync(path.resolve(@target, f)) + # # @api private #