Added isFile and isDirectory to sharedFolder api

pull/3094/head
ioedeveloper 5 years ago
parent 899c956df7
commit 0431047951
  1. 15
      src/services/sharedFolder.js

@ -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})

Loading…
Cancel
Save