cmd/ghcs/delete: When matching repos to delete, standardize casing
- It was possible to delete Codespaces for repo `SomePerson/foo` but not `someperson/foo`, despite the fact that the GitHub APIs don't actually care about casing - `SomePerson` and `someperson` is the same account. - This fixes that by lowercasing both the user-provided repo name, and the repository that is attached to the Codespace for a match. - Fixes #76.
This commit is contained in:
parent
00502e9263
commit
5af1cccb73
1 changed files with 2 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/github/ghcs/api"
|
||||
"github.com/github/ghcs/cmd/ghcs/output"
|
||||
|
|
@ -124,7 +125,7 @@ func DeleteByRepo(repo string) error {
|
|||
|
||||
var deleted bool
|
||||
for _, c := range codespaces {
|
||||
if c.RepositoryNWO != repo {
|
||||
if strings.ToLower(c.RepositoryNWO) != strings.ToLower(repo) {
|
||||
continue
|
||||
}
|
||||
deleted = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue