Skip to content

Commit

Permalink
Fixes lower and upper case for commands (#3219)
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-dass authored and Aditi Sharma committed Jun 1, 2020
1 parent c8b3233 commit 8d1c04c
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions pkg/devfile/parser/data/1.0.0/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package version100

import (
"github.com/openshift/odo/pkg/devfile/parser/data/common"
"strings"
)

func (d *Devfile100) GetMetadata() common.DevfileMetadata {
Expand Down Expand Up @@ -176,21 +177,19 @@ func convertV1ProjectToCommon(p Project) common.DevfileProject {
}

func getGroup(name string) *common.Group {
var kind common.DevfileCommandGroupType
group := common.Group{}

switch name {
case "devRun":
kind = common.RunCommandGroupType
case "devBuild":
kind = common.BuildCommandGroupType
case "devInit":
kind = common.InitCommandGroupType
default:
kind = ""
switch strings.ToLower(name) {
case "devrun":
group.Kind = common.RunCommandGroupType
group.IsDefault = true
case "devbuild":
group.Kind = common.BuildCommandGroupType
group.IsDefault = true
case "devinit":
group.Kind = common.InitCommandGroupType
group.IsDefault = true
}

return &common.Group{
// TODO(adi): IsDefault:
Kind: kind,
}
return &group
}

0 comments on commit 8d1c04c

Please sign in to comment.