Rename package stylesheets/ directory to styles/

This commit is contained in:
Nathan Sobo
2015-01-09 08:37:24 -08:00
parent 37ba67728b
commit c078f64293
2 changed files with 11 additions and 5 deletions

View File

@@ -23,8 +23,6 @@ module.exports =
class Package
EmitterMixin.includeInto(this)
@stylesheetsDir: 'stylesheets'
@isBundledPackagePath: (packagePath) ->
if atom.packages.devMode
return false unless atom.packages.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
@@ -233,7 +231,11 @@ class Package
[stylesheetPath, atom.themes.loadStylesheet(stylesheetPath, true)]
getStylesheetsPath: ->
path.join(@path, @constructor.stylesheetsDir)
if fs.isDirectorySync(path.join(@path, 'stylesheets'))
deprecate("Store package style sheets in the `styles/` directory instead of `stylesheets/`", packageName: @name)
path.join(@path, 'stylesheets')
else
path.join(@path, 'styles')
getStylesheetPaths: ->
stylesheetDirPath = @getStylesheetsPath()
@@ -299,7 +301,7 @@ class Package
if fs.isDirectorySync(path.join(@path, 'scoped-properties'))
settingsDirPath = path.join(@path, 'scoped-properties')
deprecate("Store package settings files in the `settings` directory instead of `scoped-properties`", packageName: @name)
deprecate("Store package settings files in the `settings/` directory instead of `scoped-properties/`", packageName: @name)
else
settingsDirPath = path.join(@path, 'settings')

View File

@@ -372,6 +372,10 @@ class ThemeManager
themePaths = []
for themeName in @getEnabledThemeNames()
if themePath = @packageManager.resolvePackagePath(themeName)
themePaths.push(path.join(themePath, Package.stylesheetsDir))
deprecatedPath = path.join(themePath, 'stylesheets')
if fs.isDirectorySync(deprecatedPath)
themePaths.push(deprecatedPath)
else
themePaths.push(path.join(themePath, 'styles'))
themePaths.filter (themePath) -> fs.isDirectorySync(themePath)