diff --git a/assets/pipeline-test.yaml b/assets/pipeline-test.yaml index f1a138b..8787ab8 100644 --- a/assets/pipeline-test.yaml +++ b/assets/pipeline-test.yaml @@ -11,7 +11,7 @@ pipeline: - async: appData #비동기식 실행, 해당 수행이 완료됨과 관계없이 실행하고 다음 스텝을 실행한다 - - exe: buildDart + # - exe: buildDart #일반적인 if문과 동일 - if: @@ -25,7 +25,7 @@ commands: - command: Git id: git param: - workspace: "/../dart_framework" + workspace: ./../dart_framework commands: - restore . - clean -f diff --git a/lib/oto/commands/build/build_dart.dart b/lib/oto/commands/build/build_dart.dart index 48a3dbe..0de70ab 100644 --- a/lib/oto/commands/build/build_dart.dart +++ b/lib/oto/commands/build/build_dart.dart @@ -19,7 +19,7 @@ class BuildDart extends Command { var data = DataBuildDart.fromJson(command.param); var workspace = getWorkspace(data.workspace); - var shell = StringBuffer('cd $workspace'); + var shell = StringBuffer(getCDPath(workspace)); shell.write(' && flutter clean'); shell.write(' && flutter pub upgrade --major-versions'); shell.write(' && flutter packages upgrade'); diff --git a/lib/oto/commands/command.dart b/lib/oto/commands/command.dart index 5dba552..1eba0fc 100644 --- a/lib/oto/commands/command.dart +++ b/lib/oto/commands/command.dart @@ -142,6 +142,14 @@ abstract class Command { return path; } + String getCDPath(String path) { + String drive = ''; + if (Platform.isWindows) { + drive = '${path[0]}: && '; + } + return '${drive}cd $path'; + } + String getPathNormal(String path) { return replaceTag(Path.getNormal(path)); } diff --git a/lib/oto/commands/git/git.dart b/lib/oto/commands/git/git.dart index 77db7b2..f423e47 100644 --- a/lib/oto/commands/git/git.dart +++ b/lib/oto/commands/git/git.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:oto_cli/oto/commands/command.dart'; import 'package:oto_cli/oto/data/command_data.dart'; import 'package:dart_framework/platform/process.dart'; @@ -10,13 +8,7 @@ class Git extends Command { var data = DataGit.fromJson(command.param); var workspace = getWorkspace(data.workspace); - String drive = ''; - if (Platform.isWindows) { - drive = '${workspace[0]}: && '; - } - - var shell = StringBuffer(drive); - shell.write('cd $workspace'); + var shell = StringBuffer(getCDPath(workspace)); var commands = data.commands; for (var item in commands) { shell.write(' && git ${getPathNormal(item)}');