diff --git a/src/framework/connector.ts b/src/framework/connector.ts index 57f421b..5f45a79 100644 --- a/src/framework/connector.ts +++ b/src/framework/connector.ts @@ -2,6 +2,7 @@ import { FlatMapAsyncOptions, flatMapAsync, pipe, compose, map, tap, Transform, import * as t from 'io-ts' import { PathReporter } from 'io-ts/lib/PathReporter' import R from "ramda"; +import { watchScope } from './watch'; export function connector< Config, @@ -23,7 +24,7 @@ export function connector< const executeCommands = commandExecutor(definition.resources, _scope); - return { + return watchScope({ scopeName: definition.getScopeName(config.get()), connector, @@ -79,7 +80,7 @@ export function connector< } } }, - } + }) } const connector = addPropertiesToFunction( diff --git a/src/framework/watch.ts b/src/framework/watch.ts index 0649ec3..c3dd624 100644 --- a/src/framework/watch.ts +++ b/src/framework/watch.ts @@ -1,7 +1,7 @@ import { Command, ConnectorScope, OutputElement } from "./connector"; import { onEnd, tap, compose, pipe, streamJson, transformJson } from "@space48/json-pipe"; import ipc from "node-ipc"; -import { MessageHeader, Path } from "."; +import { MessageHeader, Path, State } from "."; import { encodeHeader } from './binary-api'; import { throws } from "assert"; import { time, timeStamp } from "console"; @@ -20,7 +20,7 @@ export function watchScope(scope: ConnectorScope): ConnectorScope { } catch (e) { progress.finish(e); throw e - } + } } }; } @@ -181,7 +181,10 @@ class ExecutionProgress { }; } - recordOutput(output: unknown) { + recordOutput(output: any) { + if(State.isState(output)) { + return; + } if (this.multiCommand) { const outputEl = output as OutputElement; this.getCommandProgress(outputEl).recordOutput();