Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Clickable Template Links in Terminal azd template list #2845

Merged
merged 15 commits into from
Oct 11, 2023
11 changes: 11 additions & 0 deletions cli/azd/cmd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,22 @@ func (tl *templateListAction) Run(ctx context.Context) (*actions.ActionResult, e
return nil, err
}

// get clickable link for a repo path
clickableRepoUrl := func(repoPath string) string {
url, err := templates.Absolute(repoPath)
john0isaac marked this conversation as resolved.
Show resolved Hide resolved
if err == nil {
return output.WithHyperlink(url, repoPath)
} else {
return repoPath
}
john0isaac marked this conversation as resolved.
Show resolved Hide resolved
}

if tl.formatter.Kind() == output.TableFormat {
columns := []output.Column{
{
Heading: "Repository Path",
ValueTemplate: "{{.RepositoryPath}}",
Transformer: clickableRepoUrl,
vhvb1989 marked this conversation as resolved.
Show resolved Hide resolved
},
{
Heading: "Source",
Expand Down