Filter paths while recursing

This commit is contained in:
Kevin Sawicki
2013-05-29 22:53:52 -07:00
parent 9977f4efab
commit 91cb03a43c

View File

@@ -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)