From 91cb03a43cd12a59cdef2f375486a4da15e0cc9e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 29 May 2013 22:53:52 -0700 Subject: [PATCH] Filter paths while recursing --- Gruntfile.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index a25b7f6b7..3560f6376 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -9,9 +9,10 @@ APP_DIR = path.join(BUILD_DIR, APP_NAME, 'Contents', 'Resources', 'app') INSTALL_DIR = path.join('/Applications', APP_NAME) module.exports = (grunt) -> - cp = (source, destination) -> + cp = (source, destination, {filter}={}) -> if grunt.file.isDir(source) grunt.file.recurse source, (sourcePath, rootDirectory, subDirectory='', filename) -> + return if filter?.test(sourcePath) destinationPath = path.join(destination, subDirectory, filename) grunt.file.copy(sourcePath, destinationPath) if grunt.file.exists(destinationPath)