Skip to content

Commit

Permalink
Merge pull request #61 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 3.1.2
  • Loading branch information
Baggerone authored Apr 24, 2023
2 parents ab6abf4 + bd05da9 commit 7f76c1d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/variablesAdd.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ func runVariablesAdd() {
return
}

func addWorkspaceVar(org, ws, key, value string) bool {
func addWorkspaceVar(org, ws, key, value string) {
if v, err := lib.GetWorkspaceVar(org, ws, key); err != nil {
println(err)
return false
errLog.Fatalf("failure checking for existence of variable '%s' in workspace '%s', %s\n", key, ws, err)
} else if v != nil {
fmt.Printf("'%s' already exists in '%s'. Use 'variable update' command to change the value.", key, value)
return false
errLog.Fatalf("'%s' already exists in '%s'. Use 'variable update' command to change the value.\n", key, ws)
}

fmt.Printf("Workspace %s: Adding variable %s = %s\n", ws, key, value)
Expand All @@ -89,8 +87,8 @@ func addWorkspaceVar(org, ws, key, value string) bool {
SearchOnVariableValue: false,
SensitiveVariable: false,
}); err != nil {
return false
errLog.Fatalf("failed to add variable '%s' in workspace '%s', %s\n", key, ws, err)
}
}
return true
return
}

0 comments on commit 7f76c1d

Please sign in to comment.