You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
499 B
21 lines
499 B
const root = require('./root');
|
|
|
|
const fs = require('fs');
|
|
|
|
exports = function(path) {
|
|
return new root.Promise(function(resolve, reject) {
|
|
fs.stat(path, function(err, stats) {
|
|
if (err) {
|
|
if (err.code === 'ENOENT') {
|
|
resolve(false);
|
|
} else {
|
|
reject(err);
|
|
}
|
|
} else {
|
|
resolve(stats.isDirectory());
|
|
}
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = exports;
|
|
|