Copy themes to ~/.atom/themes when config loads

This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-02-22 14:44:57 -08:00
parent fa81871907
commit 31d8151c3e
3 changed files with 19 additions and 25 deletions

View File

@@ -34,13 +34,21 @@ class Config
return if fs.exists(@configDirPath)
fs.makeDirectory(@configDirPath)
templateConfigDirPath = fs.resolve(window.resourcePath, 'dot-atom')
onConfigDirFile = (path) =>
templatePath = fs.join(templateConfigDirPath, path)
configPath = fs.join(@configDirPath, path)
fs.write(configPath, fs.read(templatePath))
onConfigDirPath = (path) -> true
fs.traverseTree(templateConfigDirPath, onConfigDirFile, onConfigDirPath)
fs.traverseTree(templateConfigDirPath, onConfigDirFile, (path) -> true)
configThemeDirPath = fs.join(@configDirPath, 'themes')
onThemeDirFile = (path) ->
templatePath = fs.join(bundledThemesDirPath, path)
configPath = fs.join(configThemeDirPath, path)
fs.write(configPath, fs.read(templatePath))
fs.traverseTree(bundledThemesDirPath, onThemeDirFile, (path) -> true)
load: ->
@initializeConfigDirectory()