 
     s3Client = prepareS3()
     if s3Client
-      Promise.all([runEmailIntegrationTest(), uploadDMGToS3(s3Client), uploadZipToS3(s3Client)])
-      .then ->
-        done()
-      .catch (err) ->
-        grunt.log.error(err)
-        return false
+      runEmailIntegrationTest().then ->
+        Promise.all([uploadDMGToS3(s3Client), uploadZipToS3(s3Client)])
+        .then ->
+          done()
+        .catch (err) ->
+          grunt.log.error(err)
+          return false
     else
       return false


  runEmailIntegrationTest = (s3Client) ->
    buildDir = grunt.config.get('atom.buildDir')
    new Promise (resolve, reject) ->
      appToRun = path.join(buildDir, appName())
      scriptToRun = "./build/run-build-and-send-screenshot.scpt"
      spawn
        cmd: "osascript"
        args: [scriptToRun, appToRun, getVersion()]
      , (error) ->
        if error
          reject(error)

          write(">> Uploading #{destName} #{pc}%")
      uploader.on "end", (data) ->
        resolve(data)

  uploadDMGToS3 = (s3Client) ->
    destName = "#{process.platform}/Edgehill_#{getVersion()}.dmg"
