           installAtomShell(atomShellVersion)
           rebuildNativeModules(currentAtomShellVersion, done)
         else
-          downloadAtomShell atomShellVersion, (error, zipPath) ->
+          downloadAtomShellOfVersion atomShellVersion, (error, zipPath) ->
             if zipPath?
               unzipAtomShell zipPath, (error) ->
                 if error?


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

  getAtomShellVersion = ->
    versionPath = path.join('atom-shell', 'version')

        else
          grunt.log.error("atom-shell #{version.cyan} request failed")
        callback(false)

  downloadAtomShellOfVersion = (version, callback) ->
    findReleaseIdFromAtomShellVersion version, (error, releaseId) ->
      if error?
        callback(error)
      else
        getAtomShellDownloadUrl version, releaseId, (error, url) ->
          if error?
            callback(error)
          else
            downloadAtomShell version, url, callback

  unzipAtomShell = (zipPath, callback) ->
    grunt.log.writeln('Unzipping atom-shell')
