|
|
@ -17,9 +17,9 @@ module.exports = class RemixDProvider { |
|
|
|
|
|
|
|
|
|
|
|
var remixdEvents = ['connecting', 'connected', 'errored', 'closed'] |
|
|
|
var remixdEvents = ['connecting', 'connected', 'errored', 'closed'] |
|
|
|
remixdEvents.forEach((value) => { |
|
|
|
remixdEvents.forEach((value) => { |
|
|
|
// remixd.event.register(value, (event) => {
|
|
|
|
remixd.event.register(value, (event) => { |
|
|
|
// this.event.trigger(value, [event])
|
|
|
|
this.event.trigger(value, [event]) |
|
|
|
// })
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// remixd.event.register('notified', (data) => {
|
|
|
|
// remixd.event.register('notified', (data) => {
|
|
|
@ -69,7 +69,7 @@ module.exports = class RemixDProvider { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// @TODO: refactor all `this._appManager.call(....)` uses into `this.remixd[api](...)`
|
|
|
|
// @TODO: refactor all `this._remixd.call(....)` uses into `this.remixd[api](...)`
|
|
|
|
// where `api = ...`:
|
|
|
|
// where `api = ...`:
|
|
|
|
// this.remixd.read(path, (error, content) => {})
|
|
|
|
// this.remixd.read(path, (error, content) => {})
|
|
|
|
// this.remixd.write(path, content, (error, result) => {})
|
|
|
|
// this.remixd.write(path, content, (error, result) => {})
|
|
|
@ -182,7 +182,7 @@ module.exports = class RemixDProvider { |
|
|
|
const unprefixedpath = this.removePrefix(path) |
|
|
|
const unprefixedpath = this.removePrefix(path) |
|
|
|
const callId = await this._appManager.call('remixd', 'isDirectory', {path: unprefixedpath}) |
|
|
|
const callId = await this._appManager.call('remixd', 'isDirectory', {path: unprefixedpath}) |
|
|
|
|
|
|
|
|
|
|
|
return await this._appManager.receiveResponse(callId) |
|
|
|
return await this._remixd.receiveResponse(callId) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async isFile (path) { |
|
|
|
async isFile (path) { |
|
|
@ -192,7 +192,7 @@ module.exports = class RemixDProvider { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function remixapi (appManager, self) { |
|
|
|
function remixapi (remixd, self) { |
|
|
|
const read = (path, callback) => { |
|
|
|
const read = (path, callback) => { |
|
|
|
path = '' + (path || '') |
|
|
|
path = '' + (path || '') |
|
|
|
path = pathtool.join('./', path) |
|
|
|
path = pathtool.join('./', path) |
|
|
|