2026-03-21 21:50:24 -06:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/sdk/gitea"
|
2026-04-11 10:34:34 -06:00
|
|
|
"forgejo.zerova.net/public/fgj-sid/internal/api"
|
|
|
|
|
"forgejo.zerova.net/public/fgj-sid/internal/config"
|
2026-03-21 21:50:24 -06:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var labelCmd = &cobra.Command{
|
|
|
|
|
Use: "label",
|
|
|
|
|
Short: "Manage labels",
|
|
|
|
|
Long: "List, create, edit, and delete repository labels.",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var labelListCmd = &cobra.Command{
|
|
|
|
|
Use: "list",
|
|
|
|
|
Short: "List labels for a repository",
|
|
|
|
|
Long: "List all labels defined in a repository.",
|
|
|
|
|
Example: ` # List labels for the current repository
|
|
|
|
|
fgj label list
|
|
|
|
|
|
|
|
|
|
# List labels for a specific repository
|
|
|
|
|
fgj label list -R owner/repo
|
|
|
|
|
|
|
|
|
|
# Output as JSON
|
|
|
|
|
fgj label list --json`,
|
|
|
|
|
RunE: runLabelList,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var labelCreateCmd = &cobra.Command{
|
|
|
|
|
Use: "create <name>",
|
|
|
|
|
Short: "Create a label",
|
|
|
|
|
Long: "Create a new label in a repository.",
|
|
|
|
|
Example: ` # Create a label with a color
|
|
|
|
|
fgj label create bug -c ff0000
|
|
|
|
|
|
|
|
|
|
# Create a label with color and description
|
|
|
|
|
fgj label create feature -c 00ff00 -d "New feature request"
|
|
|
|
|
|
|
|
|
|
# Create a label in a specific repository
|
|
|
|
|
fgj label create urgent -c ff0000 -R owner/repo`,
|
|
|
|
|
Args: cobra.ExactArgs(1),
|
|
|
|
|
RunE: runLabelCreate,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var labelEditCmd = &cobra.Command{
|
|
|
|
|
Use: "edit <name>",
|
|
|
|
|
Short: "Edit a label",
|
|
|
|
|
Long: "Edit an existing label in a repository.",
|
|
|
|
|
Example: ` # Rename a label
|
|
|
|
|
fgj label edit bug --name bugfix
|
|
|
|
|
|
|
|
|
|
# Change the color of a label
|
|
|
|
|
fgj label edit bug -c 00ff00
|
|
|
|
|
|
|
|
|
|
# Update description
|
|
|
|
|
fgj label edit bug -d "Something is broken"`,
|
|
|
|
|
Args: cobra.ExactArgs(1),
|
|
|
|
|
RunE: runLabelEdit,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var labelDeleteCmd = &cobra.Command{
|
|
|
|
|
Use: "delete <name>",
|
|
|
|
|
Short: "Delete a label",
|
|
|
|
|
Long: "Delete a label from a repository.",
|
|
|
|
|
Example: ` # Delete a label
|
|
|
|
|
fgj label delete bug
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
# Delete without confirmation
|
|
|
|
|
fgj label delete bug -y
|
|
|
|
|
|
2026-03-21 21:50:24 -06:00
|
|
|
# Delete a label from a specific repository
|
|
|
|
|
fgj label delete bug -R owner/repo`,
|
|
|
|
|
Args: cobra.ExactArgs(1),
|
|
|
|
|
RunE: runLabelDelete,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
rootCmd.AddCommand(labelCmd)
|
|
|
|
|
labelCmd.AddCommand(labelListCmd)
|
|
|
|
|
labelCmd.AddCommand(labelCreateCmd)
|
|
|
|
|
labelCmd.AddCommand(labelEditCmd)
|
|
|
|
|
labelCmd.AddCommand(labelDeleteCmd)
|
|
|
|
|
|
|
|
|
|
labelListCmd.Flags().StringP("repo", "R", "", "Repository in owner/name format")
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
addJSONFlags(labelListCmd, "Output as JSON")
|
2026-03-21 21:50:24 -06:00
|
|
|
|
|
|
|
|
labelCreateCmd.Flags().StringP("repo", "R", "", "Repository in owner/name format")
|
|
|
|
|
labelCreateCmd.Flags().StringP("color", "c", "", "Label color (hex, e.g. 00ff00)")
|
|
|
|
|
labelCreateCmd.Flags().StringP("description", "d", "", "Label description")
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
addJSONFlags(labelCreateCmd, "Output as JSON")
|
2026-03-21 21:50:24 -06:00
|
|
|
|
|
|
|
|
labelEditCmd.Flags().StringP("repo", "R", "", "Repository in owner/name format")
|
|
|
|
|
labelEditCmd.Flags().String("name", "", "New name for the label")
|
|
|
|
|
labelEditCmd.Flags().StringP("color", "c", "", "New color (hex, e.g. 00ff00)")
|
|
|
|
|
labelEditCmd.Flags().StringP("description", "d", "", "New description")
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
addJSONFlags(labelEditCmd, "Output as JSON")
|
2026-03-21 21:50:24 -06:00
|
|
|
|
|
|
|
|
labelDeleteCmd.Flags().StringP("repo", "R", "", "Repository in owner/name format")
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
labelDeleteCmd.Flags().BoolP("yes", "y", false, "Skip confirmation prompt")
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newLabelClient(cmd *cobra.Command) (*api.Client, string, string, error) {
|
|
|
|
|
repo, _ := cmd.Flags().GetString("repo")
|
|
|
|
|
owner, name, err := parseRepo(repo)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, "", "", err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cfg, err := config.Load()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, "", "", err
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-23 12:39:51 -06:00
|
|
|
client, err := api.NewClientFromConfig(cfg, "", getDetectedHost(), getCwd())
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return nil, "", "", err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return client, owner, name, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// findLabelByName lists all repo labels and returns the one matching the given name.
|
|
|
|
|
func findLabelByName(client *api.Client, owner, repo, labelName string) (*gitea.Label, error) {
|
|
|
|
|
labels, _, err := client.ListRepoLabels(owner, repo, gitea.ListLabelsOptions{})
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, fmt.Errorf("failed to list labels: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for _, l := range labels {
|
|
|
|
|
if strings.EqualFold(l.Name, labelName) {
|
|
|
|
|
return l, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("label not found: %s", labelName)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runLabelList(cmd *cobra.Command, args []string) error {
|
|
|
|
|
client, owner, name, err := newLabelClient(cmd)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Fetching labels...")
|
2026-03-21 21:50:24 -06:00
|
|
|
labels, _, err := client.ListRepoLabels(owner, name, gitea.ListLabelsOptions{})
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf("failed to list labels: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
if wantJSON(cmd) {
|
|
|
|
|
return outputJSON(cmd, labels)
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if len(labels) == 0 {
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
fmt.Fprintln(ios.Out, "No labels found")
|
2026-03-21 21:50:24 -06:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
tp := ios.NewTablePrinter()
|
|
|
|
|
tp.AddHeader("NAME", "COLOR", "DESCRIPTION")
|
2026-03-21 21:50:24 -06:00
|
|
|
for _, l := range labels {
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
tp.AddRow(l.Name, l.Color, l.Description)
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
return tp.Render()
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runLabelCreate(cmd *cobra.Command, args []string) error {
|
|
|
|
|
labelName := args[0]
|
|
|
|
|
color, _ := cmd.Flags().GetString("color")
|
|
|
|
|
description, _ := cmd.Flags().GetString("description")
|
|
|
|
|
|
|
|
|
|
client, owner, name, err := newLabelClient(cmd)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Creating label...")
|
2026-03-21 21:50:24 -06:00
|
|
|
label, _, err := client.CreateLabel(owner, name, gitea.CreateLabelOption{
|
|
|
|
|
Name: labelName,
|
|
|
|
|
Color: color,
|
|
|
|
|
Description: description,
|
|
|
|
|
})
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf("failed to create label: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
if wantJSON(cmd) {
|
|
|
|
|
return outputJSON(cmd, label)
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
cs := ios.ColorScheme()
|
|
|
|
|
fmt.Fprintf(ios.Out, "%s Label created: %s\n", cs.SuccessIcon(), label.Name)
|
2026-03-21 21:50:24 -06:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runLabelEdit(cmd *cobra.Command, args []string) error {
|
|
|
|
|
labelName := args[0]
|
|
|
|
|
|
|
|
|
|
client, owner, name, err := newLabelClient(cmd)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Fetching label...")
|
2026-03-21 21:50:24 -06:00
|
|
|
existing, err := findLabelByName(client, owner, name, labelName)
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
opt := gitea.EditLabelOption{}
|
|
|
|
|
changed := false
|
|
|
|
|
|
|
|
|
|
if cmd.Flags().Changed("name") {
|
|
|
|
|
n, _ := cmd.Flags().GetString("name")
|
|
|
|
|
opt.Name = &n
|
|
|
|
|
changed = true
|
|
|
|
|
}
|
|
|
|
|
if cmd.Flags().Changed("color") {
|
|
|
|
|
c, _ := cmd.Flags().GetString("color")
|
|
|
|
|
opt.Color = &c
|
|
|
|
|
changed = true
|
|
|
|
|
}
|
|
|
|
|
if cmd.Flags().Changed("description") {
|
|
|
|
|
d, _ := cmd.Flags().GetString("description")
|
|
|
|
|
opt.Description = &d
|
|
|
|
|
changed = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !changed {
|
|
|
|
|
return fmt.Errorf("no changes specified; use flags like --name, --color, or --description")
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Updating label...")
|
2026-03-21 21:50:24 -06:00
|
|
|
label, _, err := client.EditLabel(owner, name, existing.ID, opt)
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf("failed to edit label: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
if wantJSON(cmd) {
|
|
|
|
|
return outputJSON(cmd, label)
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
cs := ios.ColorScheme()
|
|
|
|
|
fmt.Fprintf(ios.Out, "%s Label updated: %s\n", cs.SuccessIcon(), label.Name)
|
2026-03-21 21:50:24 -06:00
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func runLabelDelete(cmd *cobra.Command, args []string) error {
|
|
|
|
|
labelName := args[0]
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
yes, _ := cmd.Flags().GetBool("yes")
|
2026-03-21 21:50:24 -06:00
|
|
|
|
|
|
|
|
client, owner, name, err := newLabelClient(cmd)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Fetching label...")
|
2026-03-21 21:50:24 -06:00
|
|
|
existing, err := findLabelByName(client, owner, name, labelName)
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
if !yes {
|
|
|
|
|
confirmed, err := ios.ConfirmAction(fmt.Sprintf("Delete label %q?", labelName))
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
if !confirmed {
|
|
|
|
|
fmt.Fprintln(ios.ErrOut, "Aborted")
|
|
|
|
|
return nil
|
|
|
|
|
}
|
2026-03-21 21:50:24 -06:00
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StartSpinner("Deleting label...")
|
2026-03-21 21:50:24 -06:00
|
|
|
_, err = client.DeleteLabel(owner, name, existing.ID)
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
ios.StopSpinner()
|
2026-03-21 21:50:24 -06:00
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf("failed to delete label: %w", err)
|
|
|
|
|
}
|
|
|
|
|
|
feat: v0.3.0d — add PR checks, iostreams, aliases, and broad enhancements
Add PR checks command, iostreams/text packages for colored table output,
top-level run/workflow aliases matching gh CLI structure. Enhance actions,
issues, PRs, releases, repos, labels, milestones, and wiki commands with
improved flags, JSON output, and error handling.
2026-03-23 11:42:44 -06:00
|
|
|
cs := ios.ColorScheme()
|
|
|
|
|
fmt.Fprintf(ios.Out, "%s Label deleted: %s\n", cs.SuccessIcon(), labelName)
|
2026-03-21 21:50:24 -06:00
|
|
|
return nil
|
|
|
|
|
}
|