+async = require 'async'
 {BufferedNodeProcess} = require 'atom'
 {Emitter} = require 'emissary'
-async = require 'async'
 
 module.exports =
 class PackageManager

    exit = (code, stdout, stderr) ->
      if code is 0
        atom.packages.unloadPackage(name) if atom.packages.isPackageLoaded(name)
        callback()
      else
        error = new Error("Uninstalling '#{name}' failed.")
        error.stdout = stdout


    @runCommand(command, args, exit)

  uninstall: (pack, callback) ->
    {name, theme} = pack
    atom.packages.deactivatePackage(name) if atom.packages.isPackageActive(name)

    command = @apmCommand
