 }
 
 #
+# extension to gulp to get the current task name
+gulp.Gulp.prototype.__runTask = gulp.Gulp.prototype._runTask
+gulp.Gulp.prototype._runTask = (task) ->
+    this.currentTask = task
+    this.__runTask(task)
+#
 # create tasks for different platforms and architectures supported
 platformOpts.map (plat) ->
+    # create a task per platform
     gulp.task "deploy:#{plat}", ->
         args = this.currentTask.name.replace('deploy:', '')
         deferred = Q.defer()

    opts.platform = platform
    opts.arch = arch
    #
    packager opts, (err, appPaths) ->
        if err?
            console.log ('Error: ' + err) if err?

    #
    #
    archOpts.map (arch) ->
        # create a task per platform/architecture
        gulp.task "deploy:#{plat}-#{arch}", ->
            deferred = Q.defer()
            args = this.currentTask.name.replace('deploy:', '').split('-')
            deploy args[0], args[1], () ->
                deferred.resolve()
            deferred.promise
#
# task to deploy all
gulp.task 'deploy', ->
