             child.on 'exit', (code) ->
                 if code == 0
                     console.log "Created #{target} (#{packageName})"
-                    done()
                 else
-                    console.log "Possible problem with #{target} #{packageName} " +
-                        "-- (exit with #{code})"
-                    done()
+                    console.log "Possible problem with #{target} " +
+                        "(exit with code #{code})"
+                    console.log 'fpm arguments: ' + fpmArgs.join(' ')
                     process.exit(1)
-        names['linux'].push 'deploy:linux-' + arch + ':' + target
-        allNames.push('deploy:linux-' + arch + ':' + target)
+            return child
+        #names['linux'].push 'deploy:linux-' + arch + ':' + target
+        #allNames.push('deploy:linux-' + arch + ':' + target)
 
     gulp.task 'deploy:linux-' + arch + ':flatpak', (done) ->
         flatpakOptions =

                console.log "Created flatpak (#{json.name}_#{json.version}_#{arch}.flatpak)"
                done()

    names['linux'].push 'deploy:linux-' + arch + ':flatpak'
    allNames.push('deploy:linux-' + arch + ':flatpak')

# create tasks for different platforms and architectures supported
platformOpts.map (plat) ->

                "./dist/#{json.name}-linux-#{arch}/.=/opt/#{json.name}"
                "./resources/linux/app.desktop=/usr/share/applications/#{json.name}.desktop"
            ].concat iconArgs
            child = spawn 'fpm', fpmArgs
            child.stdout.on 'data', (data) ->
              # do nothing
              console.log("fpm: #{data}");
              return true
            # log all errors
            child.on 'error', (err) ->
                console.log 'Error: ' + err, fpmArgs
