From cdd4c9669abd844dc300dd4dab6efbdc5b28ad79 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 28 Oct 2013 13:44:37 -0700 Subject: [PATCH] Handle walkdir error events --- tasks/task-helpers.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/task-helpers.coffee b/tasks/task-helpers.coffee index 4adb4fc32..c44c890e0 100644 --- a/tasks/task-helpers.coffee +++ b/tasks/task-helpers.coffee @@ -4,7 +4,7 @@ walkdir = require 'walkdir' module.exports = (grunt) -> cp: (source, destination, {filter}={}) -> - walkdir.sync source, (sourcePath, stats) -> + walker = walkdir.sync source, (sourcePath, stats) -> return if filter?.test(sourcePath) destinationPath = path.join(destination, path.relative(source, sourcePath)) @@ -16,6 +16,7 @@ module.exports = (grunt) -> if grunt.file.exists(destinationPath) fs.chmodSync(destinationPath, fs.statSync(sourcePath).mode) + walker.on 'error', (error) -> grunt.fatal(error) grunt.log.writeln("Copied #{source.cyan} to #{destination.cyan}.")