mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Ignore theme names that cannot be resolved
This commit is contained in:
@@ -23,6 +23,10 @@ describe "ThemeManager", ->
|
||||
expect(paths[0]).toContain 'atom-dark-ui'
|
||||
expect(paths[1]).toContain 'atom-light-ui'
|
||||
|
||||
it "ignores themes that cannot be resolved to a directory", ->
|
||||
config.set('core.themes', ['definitely-not-a-theme'])
|
||||
expect(-> themeManager.getImportPaths()).not.toThrow()
|
||||
|
||||
describe "when the core.themes config value changes", ->
|
||||
it "add/removes stylesheets to reflect the new config value", ->
|
||||
themeManager.on 'reloaded', reloadHandler = jasmine.createSpy()
|
||||
|
||||
@@ -107,8 +107,10 @@ class ThemeManager
|
||||
if @activeThemes.length > 0
|
||||
themePaths = (theme.getStylesheetsPath() for theme in @activeThemes when theme)
|
||||
else
|
||||
themeNames = config.get('core.themes')
|
||||
themePaths = (path.join(@resolveThemePath(themeName), AtomPackage.stylesheetsDir) for themeName in themeNames)
|
||||
themePaths = []
|
||||
for themeName in config.get('core.themes') ? []
|
||||
if themePath = @resolveThemePath(themeName)
|
||||
themePaths.push(path.join(themePath, AtomPackage.stylesheetsDir))
|
||||
|
||||
themePath for themePath in themePaths when fsUtils.isDirectorySync(themePath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user