|
|
|
@ -63,7 +63,8 @@ module.exports = { |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
exists: function (args, cb) { |
|
|
|
|
var path = utils.absolutePath(args.path, this.currentSharedFolder) |
|
|
|
|
const path = utils.absolutePath(args.path, this.currentSharedFolder) |
|
|
|
|
|
|
|
|
|
cb(null, fs.existsSync(path)) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -116,6 +117,18 @@ module.exports = { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isDirectory: function (args, cb) { |
|
|
|
|
const path = utils.absolutePath(args.path, this.currentSharedFolder) |
|
|
|
|
|
|
|
|
|
cb(null, fs.statSync(path).isDirectory()) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isFile: function (args, cb) { |
|
|
|
|
const path = utils.absolutePath(args.path, this.currentSharedFolder) |
|
|
|
|
|
|
|
|
|
cb(null, fs.statSync(path).isFile()) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setupNotifications: function (path) { |
|
|
|
|
if (!isRealPath(path)) return |
|
|
|
|
var watcher = chokidar.watch(path, {depth: 0, ignorePermissionErrors: true}) |
|
|
|
|