balena-cli/lib/fs-utils/fs-utils.coffee
2014-11-14 12:58:05 -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())