I'm setting up a Cakefile that will compile and minify my CoffeeScript and minify my Vanilla libs.
I created different tasks for each case (whether it was a coffee file or not) but I want to combine them into one task.
The problem I'm having is calling a method from the task; I can call a method with no problem under some circumstances, but otherwise I receive
TypeError: undefined is not a function
The object I'm working on looks like
source =
libs: [
'lib/jquery-1.7.1.min.js'
'lib/backbone.js'
'lib/underscore.js'
]
coffees: [
'app/800cart.coffee'
'app/models/coffee/cart.coffee'
'app/models/coffee/contact.coffee'
]
And Im wanting to do this, and I get the error
task 'build', 'Concat, compile, and minify files', ->
for fileType, files of source
concatinate files
concatinate = (files) ->
console.log 'concatinating'
The part that I'm really confused by is if I call the method with a condition it runs fine
task 'build', 'Concat, compile, and minify files', ->
for fileType, files of source
concatinate files if fileType is 'coffees'
concatinate = (files) ->
console.log 'concatinating'
What am I doing wrong here?