Register hidden stub commands for official GitHub extensions (gh-aw, gh-stack) that offer to install the extension when invoked. This replaces the error-string-matching approach from the original PR with proper cobra commands that: - Avoid false-positive matches on flag values or post-'--' args - Eliminate conflicting cobra 'Did you mean?' suggestions - Properly propagate prompt/install errors for correct exit codes - Are hidden from help output and shell completions - Use GroupID "extension" so checkValidExtension allows installing over them - Are registered after extensions and aliases so both take priority Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
15 lines
380 B
Go
15 lines
380 B
Go
package extensions
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestOfficialExtension_Repository(t *testing.T) {
|
|
ext := &OfficialExtension{Name: "stack", Owner: "github", Repo: "gh-stack"}
|
|
repo := ext.Repository()
|
|
assert.Equal(t, "github", repo.RepoOwner())
|
|
assert.Equal(t, "gh-stack", repo.RepoName())
|
|
assert.Equal(t, "github.com", repo.RepoHost())
|
|
}
|