From 1df374bbfb0d646915ad52980d6fe3526b01a9ba Mon Sep 17 00:00:00 2001 From: Illya Yalovyy Date: Thu, 11 Nov 2021 16:28:32 -0800 Subject: [PATCH] fix: progress bar doesn't show any progress (#166) --- packages/cli/internal/pkg/aws/cdk/execute_cdk.go | 3 +-- packages/cli/internal/pkg/aws/cdk/execute_cdk_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cli/internal/pkg/aws/cdk/execute_cdk.go b/packages/cli/internal/pkg/aws/cdk/execute_cdk.go index 0548f509..b9f88da9 100644 --- a/packages/cli/internal/pkg/aws/cdk/execute_cdk.go +++ b/packages/cli/internal/pkg/aws/cdk/execute_cdk.go @@ -16,7 +16,7 @@ import ( var ExecuteCdkCommand = executeCdkCommand var execCommand = exec.Command -var progressRegex = regexp.MustCompile(`^\s*([0-9]+/[0-9]+)\s*\|(.*)`) +var progressRegex = regexp.MustCompile(`^.*\|\s*([0-9]+/[0-9]+)\s*\|(.*)`) var osRemoveAll = os.RemoveAll @@ -44,7 +44,6 @@ func executeCdkCommandAndCleanupDirectory(appDir string, commandArgs []string, t if err != nil { progressChan <- ProgressEvent{Err: err} } - }() return progressChan, nil } diff --git a/packages/cli/internal/pkg/aws/cdk/execute_cdk_test.go b/packages/cli/internal/pkg/aws/cdk/execute_cdk_test.go index 62452779..e9f66d6a 100644 --- a/packages/cli/internal/pkg/aws/cdk/execute_cdk_test.go +++ b/packages/cli/internal/pkg/aws/cdk/execute_cdk_test.go @@ -16,7 +16,7 @@ import ( const ( testExecuteCommandSuccessArg = "test-execute-command-success-arg" testExecuteCommandFailureArg = "test-execute-command-failure-arg" - testExecuteCommandProgressLine = " 3/10 |4:56:17 PM | CREATE_COMPLETE | AWS::IAM::Policy | TaskBatch/BatchRole/DefaultPolicy (TaskBatchBatchRoleDefaultPolicyB9AAE3A1)" + testExecuteCommandProgressLine = "Agc-Context-Demo-yy110HKO4J-ctx1 | 3/10 | 3:22:16 PM | REVIEW_IN_PROGRESS | AWS::CloudFormation::Stack | Agc-Context-Demo-yy110HKO4J-ctx1 User Initiated" ) func fakeExecCommand(command string, args ...string) *exec.Cmd {