Commit 307f92f6 authored by ioedeveloper's avatar ioedeveloper Committed by yann300

Trigger add folder event

parent 6443815f
......@@ -24,7 +24,7 @@ module.exports = class RemixDProvider {
this._appManager.on('remixd', 'folderAdded', (path) => {
console.log('event listener called')
this.event.trigger('folderAdded', [path])
this.event.trigger('folderAdded', [this.addPrefix(path)])
})
this._appManager.on('remixd', 'notified', (data) => {
......@@ -182,11 +182,18 @@ module.exports = class RemixDProvider {
return path
}
addPrefix (path) {
if (path.indexOf(this.type + '/') === 0) return path
if (path[0] === '/') return 'localhost' + path
return 'localhost/' + path
}
resolveDirectory (path, callback) {
var self = this
if (path[0] === '/') path = path.substring(1)
if (!path) return callback(null, { [self.type]: { } })
const unprefixedpath = this.removePrefix(path)
console.log('unprefixedpath: ', unprefixedpath)
this._appManager.call('remixd', 'resolveDirectory', { path: unprefixedpath }).then((result) => {
callback(null, result)
}).catch(callback)
......
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