I've had issues with assuming grunt.task.run would happen synchronously inside a function like this. It seems to be working fine here, but just a warning.