Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
adaam2 committed Nov 22, 2024
1 parent 317a18e commit 4a17f4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions internal/remote/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ type RecentGeneration struct {
Published bool

// May not be set
GitRepoOrg string
GitRepo string
GitRepoOrg *string
GitRepo *string

// gen.yaml
GenerateConfig *string
Expand Down Expand Up @@ -88,8 +88,8 @@ func GetRecentWorkspaceGenerations(ctx context.Context) ([]RecentGeneration, err
CreatedAt: event.CreatedAt,
TargetName: *event.GenerateTargetName,
Target: *event.GenerateTarget,
GitRepoOrg: *event.GitRemoteDefaultOwner,
GitRepo: *event.GitRemoteDefaultRepo,
GitRepoOrg: event.GitRemoteDefaultOwner,
GitRepo: event.GitRemoteDefaultRepo,
SourceNamespace: *event.SourceNamespaceName,
SourceRevisionDigest: *event.SourceRevisionDigest,
GenerateConfig: event.GenerateConfigPreRaw,
Expand Down
12 changes: 6 additions & 6 deletions prompts/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func sourceBaseForm(ctx context.Context, quickstart *Quickstart) (*QuickstartSta

if hasRecentGenerations {
prompt := charm_internal.NewBranchPrompt(
"Do you want to base your SDK on an existing remote source?",
"Selecting 'Yes' will allow you to pick from the most recently used sources in your workspace",
"Do you want to base your SDK on an existing SDK?",
"Selecting 'Yes' will allow you to pick from the most recently used SDKs in your workspace",
&useRemoteSource,
)
if _, err := charm_internal.NewForm(huh.NewForm(prompt)).ExecuteForm(); err != nil {
Expand Down Expand Up @@ -569,8 +569,8 @@ func selectRecentGeneration(ctx context.Context, generations []remote.RecentGene
for i, generation := range generations {
label := fmt.Sprintf("%s (%s)", generation.TargetName, generation.Target)

if generation.GitRepo != "" && generation.GitRepoOrg != "" {
label += fmt.Sprintf(" %s/%s", generation.GitRepoOrg, generation.GitRepo)
if generation.GitRepo != nil && generation.GitRepoOrg != nil {
label += fmt.Sprintf(" %s/%s", *generation.GitRepoOrg, *generation.GitRepo)
}

opts[i] = huh.NewOption(label, generation.ID)
Expand All @@ -581,8 +581,8 @@ func selectRecentGeneration(ctx context.Context, generations []remote.RecentGene
// TODO: replace with updated Select API with custom option rendering when/if upstream is
// merged: https://github.com/charmbracelet/huh/pull/424
selectPrompt := charm_internal.NewSelectPrompt(
"Select a recent remote source",
"These are the most recently updated remote sources in your workspace.",
"Select a recent SDK",
"These are the most recently updated SDKs in your workspace.",
opts,
&evtId,
)
Expand Down

0 comments on commit 4a17f4a

Please sign in to comment.