Support CSON config file

Use ~/.atom/config.cson as the new default when no
config file exists.

~/.atom/config.json is still the default if they both
exist.
This commit is contained in:
Kevin Sawicki
2013-02-04 12:38:00 -08:00
parent cd07ec841d
commit bd88a0de15
3 changed files with 41 additions and 13 deletions

View File

@@ -188,6 +188,14 @@ module.exports =
else
JSON.parse(contents)
writeObject: (path, object) ->
if @extension(path) is '.cson'
CSON = require 'cson'
content = CSON.stringify(object)
else
content = JSON.stringify(object, undefined, 2)
@write(path, "#{content}\n")
readPlist: (path) ->
plist = require 'plist'
object = null