Open stevenvachon opened 10 years ago
This does work in tests though https://github.com/gruntjs/grunt/blob/master/test/util/task_test.js#L62
After looking at https://github.com/gruntjs/grunt/blob/v0.4.3/lib/grunt/task.js#L45-L47, I added:
// Support public use of task.isTaskAlias
if (_fn.alias) {
thisTask.fn.alias = _fn.alias;
}
on line 84, right after the thisTask.fn=function(){…}
, and it fixes the issue.
I wonder if anyone think twice about implementing this fix considering that grunt.task.isTaskAlias
is an undocumented function. As a plugin developer, I'm currently finding it useful for extending Grunt's core features, not so much for typical plugins.
This is a less than pretty work-around:
var queuedTask = grunt.task._queue["default"];
if ( !queuedTask.task.multi ||
queuedTask.task.multi && queuedTask.args.length
) {
console.log("not an alias");
}
This issue was never referenced, so it was probably never fixed. Re-opening for core team to see again.
It's always returning
false
. So, I ran some tests: