Skip to content

The alias import command no longer overwrites existing aliases when using --clobber #7565

@kevhlee

Description

@kevhlee

Describe the bug

When executing the alias import command with the clobber flag specified, the aliases are not overwritten.

Steps to reproduce the behavior

bugs: issue list --label=bug
co: pr checkout
features: |-
    issue list
    --label=enhancement
igrep: '!gh issue list --label="$1" | grep "$2"'
  1. Create a YAML file called aliases.yml using the aliases above.
  2. Run gh alias import using aliases.yml as input.
  3. Run gh alias import --clobber using aliases.yml as input.

Expected vs actual behavior

Expected: The aliases are overwritten and produces the following messages.

- Importing aliases from file "aliases.yml"
! Changed alias bugs
! Changed alias co
! Changed alias features
! Changed alias igrep

Actual: The aliases are not overwritten and produces the following messages.

- Importing aliases from file "aliases.yml"
X Could not import alias bugs: already a gh command, extension, or alias
X Could not import alias co: already a gh command, extension, or alias
X Could not import alias features: already a gh command, extension, or alias
X Could not import alias igrep: already a gh command, extension, or alias

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpriority-3Affects a small number of users or is largely cosmetic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions