mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Uninstall any intalled version of autocomplete-plus
This commit is contained in:
@@ -303,6 +303,9 @@ class PackageManager
|
||||
# of the first package isn't skewed by being the first to require atom
|
||||
require '../exports/atom'
|
||||
|
||||
# TODO: remove after a few atom versions.
|
||||
@uninstallAutocompletePlus()
|
||||
|
||||
packagePaths = @getAvailablePackagePaths()
|
||||
packagePaths = packagePaths.filter (packagePath) => not @isPackageDisabled(path.basename(packagePath))
|
||||
packagePaths = _.uniq packagePaths, (packagePath) -> path.basename(packagePath)
|
||||
@@ -409,6 +412,18 @@ class PackageManager
|
||||
message = "Failed to load the #{path.basename(packagePath)} package"
|
||||
atom.notifications.addError(message, {stack, detail, dismissable: true})
|
||||
|
||||
# TODO: remove these autocomplete-plus specific helpers after a few versions.
|
||||
uninstallAutocompletePlus: ->
|
||||
packageDir = null
|
||||
devDir = path.join("dev", "packages")
|
||||
for packageDirPath in @packageDirPaths
|
||||
packageDir = packageDirPath if not packageDirPath.endsWith(devDir)
|
||||
|
||||
if packageDir?
|
||||
autocompletePlusPath = path.join(packageDir, 'autocomplete-plus')
|
||||
fs.isDirectory autocompletePlusPath, (isDir, error) ->
|
||||
fs.unlink(autocompletePlusPath) if isDir
|
||||
|
||||
if Grim.includeDeprecatedAPIs
|
||||
EmitterMixin = require('emissary').Emitter
|
||||
EmitterMixin.includeInto(PackageManager)
|
||||
|
||||
Reference in New Issue
Block a user