Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

grunt.registerTask(taskName, fn) fails #1

Merged
merged 1 commit into from
Mar 6, 2013

Conversation

sethkinast
Copy link
Contributor

Apologies if I'm doing this wrong.

In Grunt 0.4, according to http://gruntjs.com/creating-tasks#basic-tasks, the method signature for grunt.registerTask is:

grunt.registerTask(taskName, [description, ] taskFunction)

Where taskFunction can be a string, an Array, or a function. However, when grunt-retro is in use, calling registerTask with the signature

grunt.registerTask(taskName, function() { ... })

fails with "TypeError: Object function foo() { ... has no method 'split'"

The attached pull request fixes the issue and the tests still pass.

…is provided and the second argument is a function, not a string or Array.
@twolfson
Copy link
Owner

twolfson commented Mar 6, 2013

Nice catch! I was thinking with the 0.3 mentality only.
https://github.com/gruntjs/grunt/blob/0.3-stable/docs/api_task.md#creating-tasks

I will add in some tests against this and merge it in.

@twolfson twolfson merged commit 239c33f into twolfson:master Mar 6, 2013
@twolfson
Copy link
Owner

twolfson commented Mar 6, 2013

Added a test and it looks great =)

Thanks for the PR!

@twolfson
Copy link
Owner

twolfson commented Mar 6, 2013

In case it wasn't clear, I bumped grunt-retro to 0.6.0 and published it to npm.

If you update your dependencies to that version, you will get your patch =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants