From e5bd097592aa7c5987d341ceb678f7b78c354e6b Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 31 Jan 2013 09:41:40 -0800 Subject: [PATCH] Use configDirPath exposed by global config object --- src/app/atom.coffee | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/atom.coffee b/src/app/atom.coffee index 43c4d942d..4630eb6fc 100644 --- a/src/app/atom.coffee +++ b/src/app/atom.coffee @@ -7,8 +7,6 @@ LoadTextMatePackagesTask = require 'load-text-mate-packages-task' messageIdCounter = 1 originalSendMessageToBrowserProcess = atom.sendMessageToBrowserProcess -configDirPath = fs.absolute("~/.atom") -userStylePath = fs.join(configDirPath, "user.css") _.extend atom, exitWhenDone: window.location.params.exitWhenDone @@ -55,14 +53,15 @@ _.extend atom, themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black'] themeNames = [themeNames] unless _.isArray(themeNames) @loadTheme(themeName) for themeName in themeNames - @loadUserStyles() + @loadUserStylesheet() loadTheme: (name) -> @loadedThemes.push Theme.load(name) - loadUserStyles: -> - if fs.exists(userStylePath) - applyStylesheet(userStylePath, fs.read(userStylePath), 'userTheme') + loadUserStylesheet: -> + userStylesheetPath = fs.join(config.configDirPath, 'user.css') + if fs.isFile(userStylesheetPath) + applyStylesheet(userStylesheetPath, fs.read(userStylesheetPath), 'userTheme') getAtomThemeStylesheets: -> themeNames = config.get("core.themes") ? ['Atom - Dark', 'IR_Black']