Add consts for targets and treat empty as prod
This commit is contained in:
parent
5e62a417d8
commit
94128d683c
2 changed files with 11 additions and 3 deletions
|
|
@ -52,6 +52,13 @@ const (
|
|||
vscsAPI = "https://online.visualstudio.com"
|
||||
)
|
||||
|
||||
const (
|
||||
VSCSTargetLocal = "local"
|
||||
VSCSTargetDevelopment = "development"
|
||||
VSCSTargetPPE = "ppe"
|
||||
VSCSTargetProduction = "production"
|
||||
)
|
||||
|
||||
// API is the interface to the codespace service.
|
||||
type API struct {
|
||||
client httpClient
|
||||
|
|
|
|||
|
|
@ -45,8 +45,9 @@ func (a *App) List(ctx context.Context, limit int, exporter cmdutil.Exporter) er
|
|||
|
||||
hasNonProdVSCSTarget := false
|
||||
for _, apiCodespace := range codespaces {
|
||||
if apiCodespace.VSCSTarget != "prod" {
|
||||
if apiCodespace.VSCSTarget != "" && apiCodespace.VSCSTarget != api.VSCSTargetProduction {
|
||||
hasNonProdVSCSTarget = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -114,11 +115,11 @@ func (a *App) List(ctx context.Context, limit int, exporter cmdutil.Exporter) er
|
|||
}
|
||||
|
||||
func formatNameForVSCSTarget(name, vscsTarget string) string {
|
||||
if vscsTarget == "dev" || vscsTarget == "local" {
|
||||
if vscsTarget == api.VSCSTargetDevelopment || vscsTarget == api.VSCSTargetLocal {
|
||||
return fmt.Sprintf("%s 🚧", name)
|
||||
}
|
||||
|
||||
if vscsTarget == "ppe" {
|
||||
if vscsTarget == api.VSCSTargetPPE {
|
||||
return fmt.Sprintf("%s ✨", name)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue