Skip to content

Commit

Permalink
feat: CDK v4 feature flag and improvements (#1576)
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-stewart authored Mar 4, 2024
1 parent 3a63b99 commit 7a0e292
Show file tree
Hide file tree
Showing 5 changed files with 288 additions and 455 deletions.
13 changes: 5 additions & 8 deletions cli/cmd/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,13 @@ func installComponent(args []string) (err error) {

stageClose, err := catalog.Stage(component, versionArg, progressClosure)
defer stageClose()
downloadComplete <- 0

if err != nil {
cli.StopProgress()
return
}

downloadComplete <- 0

params["stage_duration_ms"] = time.Since(start).Milliseconds()
cli.Event.FeatureData = params

Expand Down Expand Up @@ -633,13 +633,12 @@ func updateComponent(args []string) (err error) {

stageClose, err := catalog.Stage(component, versionArg, progressClosure)
defer stageClose()
downloadComplete <- 0
if err != nil {
cli.StopProgress()
return
}

downloadComplete <- 0

params["stage_duration_ms"] = time.Since(start).Milliseconds()
cli.Event.FeatureData = params

Expand Down Expand Up @@ -923,14 +922,13 @@ func prototypeRunComponentsInstall(_ *cobra.Command, args []string) (err error)

cli.StartProgress(fmt.Sprintf("Installing component %s...", component.Name))
err = cli.LwComponents.Install(component, version, progressClosure)
downloadComplete <- 0
cli.StopProgress()
if err != nil {
err = errors.Wrap(err, "unable to install component")
return
}

downloadComplete <- 0

cli.OutputChecklist(successIcon, "Component %s installed\n", color.HiYellowString(component.Name))

params["install_duration_ms"] = time.Since(start).Milliseconds()
Expand Down Expand Up @@ -1025,14 +1023,13 @@ func prototypeRunComponentsUpdate(args []string) (err error) {

cli.StartProgress(fmt.Sprintf("Updating component %s to version %s...", component.Name, &updateTo))
err = cli.LwComponents.Install(component, updateTo.String(), progressClosure)
downloadComplete <- 0
cli.StopProgress()
if err != nil {
err = errors.Wrap(err, "unable to update component")
return
}

downloadComplete <- 0

cli.OutputChecklist(successIcon, "Component %s updated to %s\n",
color.HiYellowString(component.Name),
color.HiCyanString(fmt.Sprintf("v%s", updateTo.String())))
Expand Down
Loading

0 comments on commit 7a0e292

Please sign in to comment.