     for {pack, latestVersion} in updates
       do (pack, latestVersion) ->
         installCommands.push (callback) ->
-          commandArgs = ["#{pack.name}@#{latestVersion}"]
+          if pack.apmInstallSource?.type is 'git'
+            commandArgs = [pack.apmInstallSource.source]
+          else
+            commandArgs = ["#{pack.name}@#{latestVersion}"]
           commandArgs.unshift('--verbose') if verbose
           new Install().run({callback, commandArgs})
 

          latestVersion = version if semver.gt(version, latestVersion)

        if latestVersion isnt pack.version and @hasRepo(pack)
          callback(null, {pack, latestVersion})
        else
          callback()

  hasRepo: (pack) ->
    Packages.getRepository(pack)?

  getAvailableUpdates: (packages, callback) ->
    async.map packages, @getLatestVersion.bind(this), (error, updates) ->
      return callback(error) if error?

      updates = _.compact(updates)
      updates.sort (updateA, updateB) ->
        updateA.pack.name.localeCompare(updateB.pack.name)


yargs = require 'yargs'
read = require 'read'
semver = require 'npm/node_modules/semver'
Git = require 'git-utils'

Command = require './command'
config = require './apm'
