Skip to content

Commit

Permalink
if -> switch
Browse files Browse the repository at this point in the history
  • Loading branch information
srstack committed May 16, 2022
1 parent 267090e commit 5173c55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/cluster/spec/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ func Initialize(base string) error {
tiupData := os.Getenv(tiuplocaldata.EnvNameComponentDataDir)
tiupHome := os.Getenv(tiuplocaldata.EnvNameHome)

if tiupData != "" {
switch {
case tiupData != "":
profileDir = tiupData
} else if tiupHome != "" {
case tiupHome != "":
profileDir = path.Join(tiupHome, tiuplocaldata.StorageParentDir, base)
} else {
default:
homeDir, err := getHomeDir()
if err != nil {
return errors.Trace(err)
Expand Down

0 comments on commit 5173c55

Please sign in to comment.