From 60401ffc6ef3a07ecf5d6b2a1e228dcef961ac2f Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 7 Dec 2020 15:49:00 +0100 Subject: [PATCH] standard --- apps/remix-ide/src/app/files/remixd-handle.js | 2 +- apps/remix-ide/src/app/panels/terminal.js | 6 ++-- libs/remixd/src/services/gitClient.ts | 36 +++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/apps/remix-ide/src/app/files/remixd-handle.js b/apps/remix-ide/src/app/files/remixd-handle.js index 6875040431..311883e020 100644 --- a/apps/remix-ide/src/app/files/remixd-handle.js +++ b/apps/remix-ide/src/app/files/remixd-handle.js @@ -84,7 +84,7 @@ export class RemixdHandle extends WebsocketPlugin { } }, 3000) this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot()) - this.call('manager', 'activatePlugin', 'git') + this.call('manager', 'activatePlugin', 'git') } } if (this.locahostProvider.isConnected()) { diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index 6d22078d65..25f3e3e546 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -103,7 +103,7 @@ class Terminal extends Plugin { }) this.on('scriptRunner', 'error', (msg) => { this.commands.error.apply(this.commands, msg.data) - }) + }) } onDeactivation () { @@ -749,9 +749,9 @@ class Terminal extends Plugin { try { let result if (script.trim().startsWith('git')) { - result = await this.call('git', 'execute', script) + result = await this.call('git', 'execute', script) } else { - result = await this.call('scriptRunner', 'execute', script) + result = await this.call('scriptRunner', 'execute', script) } if (result) self.commands.html(yo`
${result}
`) done() diff --git a/libs/remixd/src/services/gitClient.ts b/libs/remixd/src/services/gitClient.ts index 58949669d4..868a6c575e 100644 --- a/libs/remixd/src/services/gitClient.ts +++ b/libs/remixd/src/services/gitClient.ts @@ -17,24 +17,24 @@ export class GitClient extends PluginClient { this.readOnly = readOnly } - execute (cmd: string) { - assertCommand(cmd) - const options = { cwd: this.currentSharedFolder, shell: true } - const child = spawn(cmd, options) - let result = '' - let error = '' - return new Promise((resolve, reject) => { - child.stdout.on('data', (data) => { - result += data.toString() - }) - child.stderr.on('data', (err) => { - error += err.toString() - }) - child.on('close', () => { - if (error) reject(error) - else resolve(result) - }) - }) + execute (cmd: string) { + assertCommand(cmd) + const options = { cwd: this.currentSharedFolder, shell: true } + const child = spawn(cmd, options) + let result = '' + let error = '' + return new Promise((resolve, reject) => { + child.stdout.on('data', (data) => { + result += data.toString() + }) + child.stderr.on('data', (err) => { + error += err.toString() + }) + child.on('close', () => { + if (error) reject(error) + else resolve(result) + }) + }) } }