balena-cli/lib/data/data-prefix.coffee

16 lines
249 B
CoffeeScript
Raw Normal View History

2014-11-07 16:42:02 +00:00
fsUtils = require('../fs-utils/fs-utils')
prefix = null
exports.get = ->
return prefix
exports.set = (newPrefix) ->
if not fsUtils.isValidPath(newPrefix)
throw new Error('Invalid path')
prefix = newPrefix
exports.clear = ->
prefix = null