Dont remove symlinked autocomplete-plus packages

This commit is contained in:
Ben Ogle
2015-05-13 11:30:35 -07:00
parent 1abca560cd
commit a937dc2fd4
2 changed files with 7 additions and 6 deletions

View File

@@ -845,13 +845,16 @@ describe "PackageManager", ->
jasmine.unspy(atom.packages, 'uninstallAutocompletePlus')
afterEach ->
try
fs.unlink autocompletePlusPath, ->
it "removes the packages", ->
atom.packages.loadPackages()
waitsFor ->
not fs.isDirectorySync(autocompleteCSSPath) and
not fs.isSymbolicLinkSync(autocompletePlusPath)
not fs.isDirectorySync(autocompleteCSSPath)
runs ->
expect(fs.isDirectorySync(autocompleteCSSPath)).toBe false
expect(fs.isSymbolicLinkSync(autocompletePlusPath)).toBe false
expect(fs.isSymbolicLinkSync(autocompletePlusPath)).toBe true

View File

@@ -443,9 +443,7 @@ class PackageManager
Promise.all([symlinkPromise, dirPromise]).then (values) ->
[isSymLink, isDir] = values
if isSymLink
fs.unlink directory, ->
else if isDir
if not isSymLink and isDir
fs.remove directory, ->
if Grim.includeDeprecatedAPIs