Skip to content

Commit

Permalink
Use atom.getConfigDirPath() instead of atom.config.configDirPath
Browse files Browse the repository at this point in the history
  • Loading branch information
ykpythemind committed Feb 20, 2018
1 parent be9584f commit 6e8f654
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/sync-settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ SyncSettings =
path = require('path')
files[path.basename(initPath)] = content: (@fileContent initPath) ? "# initialization file (not found)"
if atom.config.get('sync-settings.syncSnippets')
files["snippets.cson"] = content: (@fileContent atom.configDirPath + "/snippets.cson") ? "# snippets file (not found)"
files["snippets.cson"] = content: (@fileContent atom.getConfigDirPath() + "/snippets.cson") ? "# snippets file (not found)"

for file in atom.config.get('sync-settings.extraFiles') ? []
ext = file.slice(file.lastIndexOf(".")).toLowerCase()
Expand All @@ -162,7 +162,7 @@ SyncSettings =
cmtend = ""
cmtend = "*/" if ext in [".css"]
files[file] =
content: (@fileContent atom.configDirPath + "/#{file}") ? "#{cmtstart} #{file} (not found) #{cmtend}"
content: (@fileContent atom.getConfigDirPath() + "/#{file}") ? "#{cmtstart} #{file} (not found) #{cmtend}"

@createClient().gists.edit
id: @getGistId()
Expand Down Expand Up @@ -244,15 +244,15 @@ SyncSettings =
fs.writeFileSync atom.styles.getUserStyleSheetPath(), file.content if atom.config.get('sync-settings.syncStyles')

when 'init.coffee'
fs.writeFileSync atom.configDirPath + "/init.coffee", file.content if atom.config.get('sync-settings.syncInit')
fs.writeFileSync atom.getConfigDirPath() + "/init.coffee", file.content if atom.config.get('sync-settings.syncInit')

when 'init.js'
fs.writeFileSync atom.configDirPath + "/init.js", file.content if atom.config.get('sync-settings.syncInit')
fs.writeFileSync atom.getConfigDirPath() + "/init.js", file.content if atom.config.get('sync-settings.syncInit')

when 'snippets.cson'
fs.writeFileSync atom.configDirPath + "/snippets.cson", file.content if atom.config.get('sync-settings.syncSnippets')
fs.writeFileSync atom.getConfigDirPath() + "/snippets.cson", file.content if atom.config.get('sync-settings.syncSnippets')

else fs.writeFileSync "#{atom.configDirPath}/#{filename}", file.content
else fs.writeFileSync "#{atom.getConfigDirPath()}/#{filename}", file.content

atom.config.set('sync-settings._lastBackupHash', res.history[0].version)

Expand Down

0 comments on commit 6e8f654

Please sign in to comment.