model filling
This commit is contained in:
parent
c27c061c15
commit
6ca82f8c2e
29 changed files with 245 additions and 132 deletions
|
@ -2,7 +2,7 @@ import {
|
|||
FilesChangeNotifierService,
|
||||
IHashesCache,
|
||||
} from "./files_change_notifier_service";
|
||||
import { ProcessMetaData } from "../model/process_model";
|
||||
import { IPipeline } from "../model/process_model";
|
||||
import { ExecutorProgramService } from "./executor_program_service";
|
||||
import {
|
||||
EXEC_EVENT,
|
||||
|
@ -18,27 +18,27 @@ import { Trigger } from "../../features/triggers/trigger_model";
|
|||
|
||||
export interface Iteration {
|
||||
hashes: IHashesCache | null;
|
||||
process: ProcessMetaData;
|
||||
process: IPipeline;
|
||||
result?: ExecError | SpawnError | ExecutorResult;
|
||||
}
|
||||
|
||||
export abstract class IStackService {
|
||||
abstract callStack: Iteration[];
|
||||
abstract path: string;
|
||||
abstract init(processed: ProcessMetaData[], path: string): void;
|
||||
abstract init(processed: IPipeline[], path: string): void;
|
||||
}
|
||||
|
||||
export class StackService extends TypedEvent<string> implements IStackService {
|
||||
callStack: Iteration[];
|
||||
path: string;
|
||||
constructor(processed: ProcessMetaData[], path: string) {
|
||||
constructor(processed: IPipeline[], path: string) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.callStack = [];
|
||||
this.init(processed);
|
||||
}
|
||||
|
||||
public init(processed: ProcessMetaData[]) {
|
||||
public init(processed: IPipeline[]) {
|
||||
for (let el of processed) {
|
||||
el = this.commandHandler(el);
|
||||
this.callStack.push({
|
||||
|
@ -47,7 +47,7 @@ export class StackService extends TypedEvent<string> implements IStackService {
|
|||
});
|
||||
}
|
||||
}
|
||||
private commandHandler(processMetaData: ProcessMetaData) {
|
||||
private commandHandler(processMetaData: IPipeline) {
|
||||
processMetaData.process.command = processMetaData.process.command.replace(
|
||||
"$PATH",
|
||||
this.path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue