MCPcopy
hub / github.com/cli/cli / GetVariableEntity

Function GetVariableEntity

pkg/cmd/variable/shared/shared.go:52–67  ·  view source on GitHub ↗
(orgName, envName string)

Source from the content-addressed store, hash-verified

50}
51
52func GetVariableEntity(orgName, envName string) (VariableEntity, error) {
53 orgSet := orgName != ""
54 envSet := envName != ""
55
56 if orgSet && envSet {
57 return "", errors.New("cannot specify multiple variable entities")
58 }
59
60 if orgSet {
61 return Organization, nil
62 }
63 if envSet {
64 return Environment, nil
65 }
66 return Repository, nil
67}
68
69func PopulateMultipleSelectedRepositoryInformation(apiClient *api.Client, host string, variables []Variable) error {
70 for i, variable := range variables {

Callers 5

getRunFunction · 0.92
removeRunFunction · 0.92
listRunFunction · 0.92
setRunFunction · 0.92
TestGetVariableEntityFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetVariableEntityFunction · 0.68