balena-cli/lib/resin/data/fs-utils/fs-utils.coffee
2014-11-26 14:22:01 -04:00

12 lines
310 B
CoffeeScript

fs = require('fs')
_ = require('lodash')
# TODO: There should be more complex checks here
exports.isValidPath = (p) ->
return _.isString(p)
exports.isDirectory = (directory, callback) ->
fs.stat directory, (error, stats) ->
return callback?(error) if error?
return callback?(null, stats.isDirectory())