import type { ScriptServer } from './classes.scriptserver.js'; import * as plugins from './plugins.js'; /* This file contains logic to execute deno commands in an ephermal way */ export class DenoExecution { public id: string; public scriptserverRef: ScriptServer; public script: string; constructor(scriptserverRef: ScriptServer, scriptArg: string) { this.scriptserverRef = scriptserverRef; this.script = scriptArg; this.id = plugins.smartunique.shortId(); } public async execute() { this.scriptserverRef.executionMap.add(this); await this.scriptserverRef.smartshellInstance.exec(`deno run http://localhost:3210/getscript/${this.id}`) } }