current template

pull/5167/head
bunsenstraat 2 months ago
parent d892a15f87
commit c4eabfca4f
  1. 6
      apps/remix-ide/src/app/tabs/script-runner-ui.tsx

@ -20,6 +20,7 @@ const profile = {
export class ScriptRunnerUIPlugin extends ViewPlugin { export class ScriptRunnerUIPlugin extends ViewPlugin {
engine: Engine engine: Engine
current: string current: string
currentTemplate: string
constructor(engine: Engine) { constructor(engine: Engine) {
super(profile) super(profile)
console.log('ScriptRunnerUIPlugin', this) console.log('ScriptRunnerUIPlugin', this)
@ -44,6 +45,7 @@ export class ScriptRunnerUIPlugin extends ViewPlugin {
await this.call('manager', 'activatePlugin', newProfile.name) await this.call('manager', 'activatePlugin', newProfile.name)
this.current = newProfile.name this.current = newProfile.name
this.currentTemplate = name
this.on(newProfile.name, 'log', this.log.bind(this)) this.on(newProfile.name, 'log', this.log.bind(this))
this.on(newProfile.name, 'info', this.log.bind(this)) this.on(newProfile.name, 'info', this.log.bind(this))
this.on(newProfile.name, 'warn', this.log.bind(this)) this.on(newProfile.name, 'warn', this.log.bind(this))
@ -52,8 +54,8 @@ export class ScriptRunnerUIPlugin extends ViewPlugin {
async execute (script: string, filePath: string) { async execute (script: string, filePath: string) {
if(!this.current) await this.loadScriptRunner('default') if(!this.current) await this.loadScriptRunner('default')
console.log('execute', script, filePath) console.log('execute', this.current)
this.call(this.current, 'execute', script, filePath) await this.call(this.current, 'execute', script, filePath)
} }
async log(data: any){ async log(data: any){

Loading…
Cancel
Save