From bca1209045fe0fa99e12609a3860028d75ee76d3 Mon Sep 17 00:00:00 2001 From: "leedongmyung[desktop]" Date: Thu, 16 Nov 2023 21:08:35 +0900 Subject: [PATCH] test --- build_win.yaml | 6 +++--- lib/cli/cli.dart | 30 +++++++++++++++++------------- lib/oto/application.dart | 10 +++------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/build_win.yaml b/build_win.yaml index c98316c..9060d93 100644 --- a/build_win.yaml +++ b/build_win.yaml @@ -3,7 +3,7 @@ common: workspace: "." commands: -### Version 쓰기 + ### Version 쓰기 - command: CreateAppData param: scm: Git @@ -12,13 +12,13 @@ commands: returnVersion: "" returnHash: "" -### 실행가능한 파일로 빌드 + ### 실행가능한 파일로 빌드 - command: BuildDartCompile param: targetDartFile: "./bin/main.dart" buildFileName: oto_cli -### 최종 zip 파일 형태로 저장 + ### 최종 zip 파일 형태로 저장 - command: Zip param: zipFile: "/release/oto_win_v.zip" diff --git a/lib/cli/cli.dart b/lib/cli/cli.dart index b26b992..19aa7f9 100644 --- a/lib/cli/cli.dart +++ b/lib/cli/cli.dart @@ -211,21 +211,25 @@ class _PrinterWindows extends Printer { var c = Completer(); StringBuffer message = StringBuffer(); message.writeln('@echo off'); - message.writeln(''); message.writeln('setlocal'); message.writeln('call :setESC'); - for (var item in printList) { - if (item.trim().isEmpty) { - message.writeln('echo.'); - } else { - item = item - .replaceAll('<', '^<') - .replaceAll('>', '^>') - // .replaceAll('[', '^[') - .replaceAll(']', '^]') - .replaceAll('|', '^|'); - message.writeln('echo $item'); + if (printList.length == 1) { + message.writeln('echo | set /p=${printList.first}'); + } else { + for (var item in printList) { + if (item.trim().isEmpty) { + message.writeln('echo.'); + } else { + item = item + // .replaceAll('<', '^<') + // .replaceAll('>', '^>') + // .replaceAll('[', '^[') + .replaceAll(']', '^]') + .replaceAll('|', '^|') + .replaceAll('\n', ''); + message.writeln('echo $item'); + } } } message.writeln(':setESC'); @@ -234,7 +238,7 @@ class _PrinterWindows extends Printer { message.writeln(' set ESC=%%b'); message.writeln(' exit /B 0'); message.writeln(')'); - message.writeln('exit /B 0'); + // message.writeln('exit /B 0'); var temp = await getTempFile(message.toString(), 'bat'); await Process.run('cmd', ['/C', temp.path]).then((ProcessResult result) { diff --git a/lib/oto/application.dart b/lib/oto/application.dart index 28050ea..4683936 100644 --- a/lib/oto/application.dart +++ b/lib/oto/application.dart @@ -72,8 +72,7 @@ class Application { _jenkinsData = DataJenkins.fromJson(jenkinsMap!); var content = await getBuildData(); - // await composeANSIPrint(content, Color.green); - await CLI.printString(CLI.style(content, color: Color.green)); + await composeANSIPrint(content, Color.green); buildMap = getMapFromYaml(content); break; @@ -82,6 +81,7 @@ class Application { var content = yamlContent!; await CLI.printString(CLI.style(content, color: Color.green)); + // await composeANSIPrint(content, Color.green); buildMap = getMapFromYaml(content); break; } @@ -92,13 +92,9 @@ class Application { Future composeANSIPrint(String value, Color color) async { var list = value.split('\n'); - List listNew = []; for (var item in list) { - var msg = CLI.style(item, color: color); - listNew.add(item); - print(msg); + await CLI.print([CLI.style(item, color: color)]); } - await CLI.print(listNew); return simpleFuture; }