smartdeno/ts/classes.smartdeno.ts

21 lines
646 B
TypeScript
Raw Normal View History

2024-03-16 23:53:32 +00:00
import { DenoDownloader } from './classes.denodownloader.js';
import * as plugins from './plugins.js';
import * as paths from './paths.js';
export class SmartDeno {
private denoDownloader = new DenoDownloader();
private smartshellInstance = new plugins.smarthshell.Smartshell({
executor: 'bash'
});
public async init(optionsArg: {
forceLocalDeno?: boolean;
} = {}) {
const denoAlreadyInPath = await plugins.smarthshell.which('deno', {
nothrow: true
});
if (!denoAlreadyInPath || optionsArg.forceLocalDeno) {
await this.denoDownloader.download(plugins.path.join(paths.nogitDir, 'deno.zip'));
}
}
}