mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
chore: remove db import from cli package (#14709)
This commit is contained in:
@ -29,7 +29,6 @@ import (
|
|||||||
"golang.org/x/mod/semver"
|
"golang.org/x/mod/semver"
|
||||||
"golang.org/x/xerrors"
|
"golang.org/x/xerrors"
|
||||||
|
|
||||||
"github.com/coder/coder/v2/coderd/database/db2sdk"
|
|
||||||
"github.com/coder/pretty"
|
"github.com/coder/pretty"
|
||||||
|
|
||||||
"github.com/coder/coder/v2/buildinfo"
|
"github.com/coder/coder/v2/buildinfo"
|
||||||
@ -658,9 +657,11 @@ func (o *OrganizationContext) Selected(inv *serpent.Invocation, client *codersdk
|
|||||||
}
|
}
|
||||||
|
|
||||||
// No org selected, and we are more than 1? Return an error.
|
// No org selected, and we are more than 1? Return an error.
|
||||||
validOrgs := db2sdk.List(orgs, func(org codersdk.Organization) string {
|
validOrgs := make([]string, 0, len(orgs))
|
||||||
return fmt.Sprintf("%q", org.Name)
|
for _, org := range orgs {
|
||||||
})
|
validOrgs = append(validOrgs, org.Name)
|
||||||
|
}
|
||||||
|
|
||||||
return codersdk.Organization{}, xerrors.Errorf("Must select an organization with --org=<org_name>. Choose from: %s", strings.Join(validOrgs, ", "))
|
return codersdk.Organization{}, xerrors.Errorf("Must select an organization with --org=<org_name>. Choose from: %s", strings.Join(validOrgs, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user