Commit daea355f authored by ioedeveloper's avatar ioedeveloper

Added isFile and isDirectory to sharedFolder api

parent eb3d850b
......@@ -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})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment