balena-cli/lib/resin/data/fs-utils/fs-utils.coffee

12 lines
310 B
CoffeeScript
Raw Normal View History

2014-11-14 16:58:05 +00:00
fs = require('fs')
2014-11-07 15:21:48 +00:00
_ = require('lodash')
2014-11-07 18:17:37 +00:00
# TODO: There should be more complex checks here
2014-11-07 15:21:48 +00:00
exports.isValidPath = (p) ->
return _.isString(p)
2014-11-14 16:58:05 +00:00
exports.isDirectory = (directory, callback) ->
fs.stat directory, (error, stats) ->
return callback?(error) if error?
return callback?(null, stats.isDirectory())