Commit 7d1fe50e authored by yann300's avatar yann300

standard

parent a789fa7f
...@@ -84,7 +84,7 @@ export class RemixdHandle extends WebsocketPlugin { ...@@ -84,7 +84,7 @@ export class RemixdHandle extends WebsocketPlugin {
} }
}, 3000) }, 3000)
this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot()) this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot())
this.call('manager', 'activatePlugin', 'git') this.call('manager', 'activatePlugin', 'git')
} }
} }
if (this.locahostProvider.isConnected()) { if (this.locahostProvider.isConnected()) {
......
...@@ -103,7 +103,7 @@ class Terminal extends Plugin { ...@@ -103,7 +103,7 @@ class Terminal extends Plugin {
}) })
this.on('scriptRunner', 'error', (msg) => { this.on('scriptRunner', 'error', (msg) => {
this.commands.error.apply(this.commands, msg.data) this.commands.error.apply(this.commands, msg.data)
}) })
} }
onDeactivation () { onDeactivation () {
...@@ -749,9 +749,9 @@ class Terminal extends Plugin { ...@@ -749,9 +749,9 @@ class Terminal extends Plugin {
try { try {
let result let result
if (script.trim().startsWith('git')) { if (script.trim().startsWith('git')) {
result = await this.call('git', 'execute', script) result = await this.call('git', 'execute', script)
} else { } else {
result = await this.call('scriptRunner', 'execute', script) result = await this.call('scriptRunner', 'execute', script)
} }
if (result) self.commands.html(yo`<pre>${result}</pre>`) if (result) self.commands.html(yo`<pre>${result}</pre>`)
done() done()
......
...@@ -17,24 +17,24 @@ export class GitClient extends PluginClient { ...@@ -17,24 +17,24 @@ export class GitClient extends PluginClient {
this.readOnly = readOnly this.readOnly = readOnly
} }
execute (cmd: string) { execute (cmd: string) {
assertCommand(cmd) assertCommand(cmd)
const options = { cwd: this.currentSharedFolder, shell: true } const options = { cwd: this.currentSharedFolder, shell: true }
const child = spawn(cmd, options) const child = spawn(cmd, options)
let result = '' let result = ''
let error = '' let error = ''
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
child.stdout.on('data', (data) => { child.stdout.on('data', (data) => {
result += data.toString() result += data.toString()
}) })
child.stderr.on('data', (err) => { child.stderr.on('data', (err) => {
error += err.toString() error += err.toString()
}) })
child.on('close', () => { child.on('close', () => {
if (error) reject(error) if (error) reject(error)
else resolve(result) else resolve(result)
}) })
}) })
} }
} }
......
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