diff --git a/lib/oto/pipeline/pipeline_condition.dart b/lib/oto/pipeline/pipeline_condition.dart index 2f99e54..9a9bb2c 100644 --- a/lib/oto/pipeline/pipeline_condition.dart +++ b/lib/oto/pipeline/pipeline_condition.dart @@ -38,12 +38,12 @@ abstract class PiplineCondition extends PipelineExecutor { return PipelineValidateResult(); } - Future printCondition( - String syntax, String postfix, ConditionCheckResult result) async { + Future printCondition(String syntax, String condition, String postfix, + ConditionCheckResult result) async { var quotesPre = Platform.isWindows ? '^"' : ''; var quotesLast = Platform.isWindows ? '"' : ''; var printStr = - '$quotesPre[$syntax] (${result.conditionValue}) : ${result.result}$postfix$quotesLast'; + '$quotesPre[$syntax] ($condition) / (${result.conditionValue}) : ${result.result} ===> $postfix$quotesLast'; await CLI.println(printStr, color: Color.magentaStrong); return simpleFuture; } diff --git a/lib/oto/pipeline/pipeline_if.dart b/lib/oto/pipeline/pipeline_if.dart index 0837daa..e07e737 100644 --- a/lib/oto/pipeline/pipeline_if.dart +++ b/lib/oto/pipeline/pipeline_if.dart @@ -36,8 +36,9 @@ class PipelineIf extends PiplineCondition { @override Future execute() async { - var result = checkCondition(data.condition!); - await printCondition('IF', getPostfix(result.result), result); + var condition = data.condition!; + var result = checkCondition(condition); + await printCondition('IF', condition, getPostfix(result.result), result); if (result.result) { await _pipelineTrue?.execute(); } else { @@ -49,12 +50,12 @@ class PipelineIf extends PiplineCondition { String getPostfix(bool condition) { if (condition) { return _pipelineTrue == null - ? ' ====> on-true not exist. Passed' - : ' ====> Execute: on-true '; + ? 'on-true not exist. Passed' + : 'Execute: on-true '; } else { return _pipelineFalse == null - ? ' ====> on-false not exist. Passed' - : ' ====> Execute: on-false '; + ? 'on-false not exist. Passed' + : 'Execute: on-false '; } } } diff --git a/lib/oto/pipeline/pipeline_while.dart b/lib/oto/pipeline/pipeline_while.dart index 0a9c4b4..4364f40 100644 --- a/lib/oto/pipeline/pipeline_while.dart +++ b/lib/oto/pipeline/pipeline_while.dart @@ -1,5 +1,4 @@ import 'package:dart_framework/utils/system_util.dart'; -import 'package:oto_cli/cli/cli.dart'; import 'package:oto_cli/oto/data/pipeline_data.dart'; import 'package:oto_cli/oto/pipeline/pipeline.dart'; import 'package:oto_cli/oto/pipeline/pipeline_condition.dart'; @@ -29,12 +28,14 @@ class PipelineWhile extends PiplineCondition { @override Future execute() async { - var result = checkCondition(data.condition!); + var condition = data.condition!; + var result = checkCondition(condition); while (result.result) { - await printCondition('While', ' ====> Execute: on-do', result); + await printCondition('While', condition, 'Execute: on-do', result); await _pipelineOnDo?.execute(); result = checkCondition(data.condition!); } + await printCondition('While', condition, 'Loop escaped.', result); return simpleFuture; } }