closeheat
Version:
Static Website Hosting with CMS without touching your code.
27 lines (21 loc) • 633 B
text/coffeescript
path = require 'path'
pkg = require '../package.json'
fs = require 'fs'
module.exports =
class Config
: ->
config_path = path.join((), 'config.json')
fs.writeFileSync(config_path, JSON.stringify(access_token: '')) unless fs.existsSync(config_path)
config_path
: ->
JSON.parse(fs.readFileSync(()).toString())
: ->
result = global.CONFIG_DIR
fs.mkdirSync(result) unless fs.existsSync result
result
: ->
pkg.version
: (key, val) ->
contents = ()
contents[key] = val
fs.writeFileSync((), JSON.stringify(contents))