           write(">> Uploading #{destName} #{pc}%")
       uploader.on "end", (data) ->
         resolve(data)
-
-  getVersion = ->
-    {version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
-    return version
 
   uploadDMGToS3 = (s3Client) ->
     destName = "#{process.platform}/Edgehill_#{getVersion()}.dmg"


module.exports = (grunt) ->
  {cp, spawn, rm} = require('./task-helpers')(grunt)

  appName = -> grunt.config.get('atom.appName')
  dmgName = -> "#{appName().split('.')[0]}.dmg"


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