mirror of
https://github.com/atom/atom.git
synced 2026-01-21 04:48:12 -05:00
Re-enable tree-view and tabs sublime-tabs is installed
This commit is contained in:
4
spec/fixtures/packages/sublime-tabs/package.json
vendored
Normal file
4
spec/fixtures/packages/sublime-tabs/package.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "sublime-tabs",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
@@ -877,3 +877,22 @@ describe "PackageManager", ->
|
||||
runs ->
|
||||
expect(fs.isDirectorySync(autocompleteCSSPath)).toBe false
|
||||
expect(fs.isSymbolicLinkSync(autocompletePlusPath)).toBe true
|
||||
|
||||
describe "when the deprecated sublime-tabs package is installed", ->
|
||||
it "enables the tree-view and tabs package", ->
|
||||
atom.config.pushAtKeyPath('core.disabledPackages', 'tree-view')
|
||||
atom.config.pushAtKeyPath('core.disabledPackages', 'tabs')
|
||||
|
||||
spyOn(atom.packages, 'getAvailablePackagePaths').andReturn [
|
||||
path.join(__dirname, 'fixtures', 'packages', 'sublime-tabs')
|
||||
path.resolve(__dirname, '..', 'node_modules', 'tree-view')
|
||||
path.resolve(__dirname, '..', 'node_modules', 'tabs')
|
||||
]
|
||||
atom.packages.loadPackages()
|
||||
|
||||
waitsFor ->
|
||||
not atom.packages.isPackageDisabled('tree-view') and not atom.packages.isPackageDisabled('tabs')
|
||||
|
||||
runs ->
|
||||
expect(atom.packages.isPackageLoaded('tree-view')).toBe true
|
||||
expect(atom.packages.isPackageLoaded('tabs')).toBe true
|
||||
|
||||
@@ -314,6 +314,10 @@ class PackageManager
|
||||
@uninstallAutocompletePlus()
|
||||
|
||||
packagePaths = @getAvailablePackagePaths()
|
||||
|
||||
# TODO: remove after a few atom versions.
|
||||
@migrateSublimeTabsSettings(packagePaths)
|
||||
|
||||
packagePaths = packagePaths.filter (packagePath) => not @isPackageDisabled(path.basename(packagePath))
|
||||
packagePaths = _.uniq packagePaths, (packagePath) -> path.basename(packagePath)
|
||||
@loadPackage(packagePath) for packagePath in packagePaths
|
||||
@@ -445,6 +449,13 @@ class PackageManager
|
||||
@uninstallDirectory(dirToRemove)
|
||||
return
|
||||
|
||||
# TODO: remove this after a few versions
|
||||
migrateSublimeTabsSettings: (packagePaths) ->
|
||||
for packagePath in packagePaths when path.basename(packagePath) is 'sublime-tabs'
|
||||
atom.config.removeAtKeyPath('core.disabledPackages', 'tree-view')
|
||||
atom.config.removeAtKeyPath('core.disabledPackages', 'tabs')
|
||||
return
|
||||
|
||||
uninstallDirectory: (directory) ->
|
||||
symlinkPromise = new Promise (resolve) ->
|
||||
fs.isSymbolicLink directory, (isSymLink) -> resolve(isSymLink)
|
||||
|
||||
Reference in New Issue
Block a user