balena-cli/lib/data/data-prefix.coffee
2014-11-17 15:20:19 -04:00

17 lines
303 B
CoffeeScript

fsUtils = require('../fs-utils/fs-utils')
prefix = null
exports.get = ->
return prefix
exports.set = (newPrefix, callback) ->
if not fsUtils.isValidPath(newPrefix)
return callback?(new Error('Invalid path'))
prefix = newPrefix
return callback?(null, prefix)
exports.clear = ->
prefix = null