mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-20 14:13:07 +00:00
20 lines
386 B
CoffeeScript
20 lines
386 B
CoffeeScript
mkdirp = require('mkdirp')
|
|
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'))
|
|
|
|
mkdirp newPrefix, (error) ->
|
|
return callback?(error) if error?
|
|
prefix = newPrefix
|
|
return callback?()
|
|
|
|
exports.clear = ->
|
|
prefix = null
|