loads ~/.atom/index.coffee when window is loaded

This commit is contained in:
Corey Johnson
2012-03-20 13:31:49 -07:00
parent adf8d5df9d
commit 6ae39f167b

View File

@@ -19,6 +19,7 @@ windowAdditions =
startup: (url) ->
@setUpKeymap()
@attachRootView(url)
@loadUserConfig()
$(window).on 'close', => @close()
$(window).focus()
atom.windowOpened this
@@ -45,6 +46,13 @@ windowAdditions =
@rootView = new RootView {url}
$(@rootViewParentSelector).append @rootView
loadUserConfig: (path="~/.atom") ->
absolutePath = fs.absolute(path)
try
require absolutePath if fs.exists(absolutePath)
catch error
console.error "Failed to load `#{absolutePath}`", error
requireStylesheet: (path) ->
fullPath = require.resolve(path)
content = fs.read(fullPath)