mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-27 17:18:51 +00:00
12 lines
310 B
CoffeeScript
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())
|