Allow for styles/ directory in themes in prebuild-less task

This commit is contained in:
Nathan Sobo 2015-01-14 19:49:07 -07:00
parent ae9e1b0416
commit f570a417e6

View File

@ -1,4 +1,5 @@
path = require 'path'
fs = require 'fs'
LessCache = require 'less-cache'
@ -25,7 +26,10 @@ module.exports = (grunt) ->
for theme in configuration
# TODO Use AtomPackage class once it runs outside of an Atom context
themePath = path.resolve('node_modules', theme)
stylesheetsDir = path.join(themePath, 'stylesheets')
if fs.existsSync(path.join(themePath, 'stylesheets'))
stylesheetsDir = path.join(themePath, 'stylesheets')
else
stylesheetsDir = path.join(themePath, 'styles')
{main} = grunt.file.readJSON(path.join(themePath, 'package.json'))
main ?= 'index.less'
mainPath = path.join(themePath, main)