mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-24 09:16:07 +08:00
f56dc18690
Summary: - You can now pass `--config-dir-path=/some/custom/path` to `./N1.sh` - `main.coffee` cleaned up a bit. A lot of unused params from legacy Atom stuff were still being used - Integration specs now set the config dir before booting. - New spec to check for the autoupdater in the app and make sure it's pointing at the right place. Test Plan: script/grunt run-integration-tests Reviewers: juan, bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D2331
32 lines
967 B
CoffeeScript
32 lines
967 B
CoffeeScript
path = require 'path'
|
|
LessCache = require 'less-cache'
|
|
|
|
# {LessCache} wrapper used by {ThemeManager} to read stylesheets.
|
|
module.exports =
|
|
class LessCompileCache
|
|
constructor: ({configDirPath, resourcePath, importPaths}) ->
|
|
@lessSearchPaths = [
|
|
path.join(resourcePath, 'static', 'variables')
|
|
path.join(resourcePath, 'static')
|
|
]
|
|
|
|
if importPaths?
|
|
importPaths = importPaths.concat(@lessSearchPaths)
|
|
else
|
|
importPaths = @lessSearchPaths
|
|
|
|
@cache = new LessCache
|
|
cacheDir: path.join(configDirPath, 'compile-cache', 'less')
|
|
importPaths: importPaths
|
|
resourcePath: resourcePath
|
|
fallbackDir: path.join(resourcePath, 'less-compile-cache')
|
|
|
|
setImportPaths: (importPaths=[]) ->
|
|
@cache.setImportPaths(importPaths.concat(@lessSearchPaths))
|
|
|
|
read: (stylesheetPath) ->
|
|
@cache.readFileSync(stylesheetPath)
|
|
|
|
cssForFile: (stylesheetPath, lessContent) ->
|
|
@cache.cssForFile(stylesheetPath, lessContent)
|