feat(core): Refactor codebase and update dependencies.
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartshell',
|
||||
version: '3.0.6',
|
||||
version: '3.1.0',
|
||||
description: 'A library for executing shell commands using promises.'
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import * as plugins from './smartshell.plugins.js';
|
||||
import * as plugins from './plugins.js';
|
||||
|
||||
/**
|
||||
* a log handler for spawned logs
|
24
ts/classes.smartexecution.ts
Normal file
24
ts/classes.smartexecution.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import * as plugins from './plugins.js'
|
||||
import { Smartshell, type IExecResultStreaming } from './classes.smartshell.js';
|
||||
|
||||
export class SmartExecution {
|
||||
public smartshell: Smartshell;
|
||||
public currentStreamingExecution: IExecResultStreaming;
|
||||
public commandString: string;
|
||||
|
||||
constructor(commandStringArg: string) {
|
||||
this.commandString = commandStringArg;
|
||||
}
|
||||
|
||||
public async restart() {
|
||||
if (!this.smartshell) {
|
||||
this.smartshell = new Smartshell({
|
||||
executor: 'bash',
|
||||
});
|
||||
}
|
||||
if (this.currentStreamingExecution) {
|
||||
await this.currentStreamingExecution.kill();
|
||||
}
|
||||
this.currentStreamingExecution = await this.smartshell.execStreaming(this.commandString);
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
import * as plugins from './smartshell.plugins.js';
|
||||
import { ShellEnv } from './smartshell.classes.shellenv.js';
|
||||
import type { IShellEnvContructorOptions, TExecutor } from './smartshell.classes.shellenv.js';
|
||||
import { ShellLog } from './smartshell.classes.shelllog.js';
|
||||
import * as plugins from './plugins.js';
|
||||
import { ShellEnv } from './classes.shellenv.js';
|
||||
import type { IShellEnvContructorOptions, TExecutor } from './classes.shellenv.js';
|
||||
import { ShellLog } from './classes.shelllog.js';
|
||||
|
||||
import * as cp from 'child_process';
|
||||
|
@@ -1,2 +1,3 @@
|
||||
export * from './smartshell.classes.smartshell.js';
|
||||
export { which } from './smartshell.plugins.js';
|
||||
export * from './classes.smartshell.js';
|
||||
export * from './classes.smartexecution.js';
|
||||
export { which } from './plugins.js';
|
||||
|
Reference in New Issue
Block a user