|
|
|
@ -3,7 +3,7 @@ |
|
|
|
|
var CONFIG_FILE = '.remix.config' |
|
|
|
|
const EventEmitter = require('events') |
|
|
|
|
|
|
|
|
|
function Config (storage) { |
|
|
|
|
function Config(storage) { |
|
|
|
|
this.items = {} |
|
|
|
|
this.unpersistedItems = {} |
|
|
|
|
this.events = new EventEmitter() |
|
|
|
@ -15,7 +15,7 @@ function Config (storage) { |
|
|
|
|
this.items = JSON.parse(config) |
|
|
|
|
} |
|
|
|
|
} catch (exception) { |
|
|
|
|
/* Do nothing. */
|
|
|
|
|
/* Do nothing. */ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.exists = function (key) { |
|
|
|
@ -30,9 +30,10 @@ function Config (storage) { |
|
|
|
|
this.items[key] = content |
|
|
|
|
try { |
|
|
|
|
storage.set(CONFIG_FILE, JSON.stringify(this.items)) |
|
|
|
|
this.events.emit('configChanged', { key, content }) |
|
|
|
|
this.events.emit(key + '_changed', content) |
|
|
|
|
} catch (exception) { |
|
|
|
|
/* Do nothing. */
|
|
|
|
|
/* Do nothing. */ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|