fix(core): update

This commit is contained in:
2024-03-17 21:24:25 +01:00
parent 8909149af8
commit 046a0ff55f
10 changed files with 116 additions and 195 deletions

View File

@@ -1,14 +1,14 @@
import { DenoDownloader } from './classes.denodownloader.js';
import * as plugins from './plugins.js';
import * as paths from './paths.js';
import { ScriptServer } from './classes.scriptserver.js';
import { DenoExecution } from './classes.denoexecution.js';
export class SmartDeno {
private denoDownloader = new DenoDownloader();
private smartshellInstance = new plugins.smarthshell.Smartshell({
executor: 'bash'
});
private scriptServer = new ScriptServer();
public async init(optionsArg: {
public async start(optionsArg: {
forceLocalDeno?: boolean;
} = {}) {
const denoAlreadyInPath = await plugins.smarthshell.which('deno', {
@@ -17,5 +17,18 @@ export class SmartDeno {
if (!denoAlreadyInPath || optionsArg.forceLocalDeno) {
await this.denoDownloader.download(plugins.path.join(paths.nogitDir, 'deno.zip'));
}
await this.scriptServer.start();
}
/**
* Stops the smartdeno instance
*/
public async stop() {
}
public async executeScript(scriptArg: string) {
const denoExecution = new DenoExecution(this.scriptServer, scriptArg);
await denoExecution.execute();
}
}