 
 module.exports = (grunt) ->
   {cp, spawn, rm} = require('./task-helpers')(grunt)
+
+  getVersion = ->
+    {version} = require(path.join(grunt.config.get('atom.appDir'), 'package.json'))
+    return version
 
   appName = -> grunt.config.get('atom.appName')
   dmgName = -> "#{appName().split('.')[0]}.dmg"


  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"
