1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-09-08 17:06:42 +00:00

include links in github tool

This commit is contained in:
Laura
2025-08-31 20:10:01 +02:00
parent 8943fd83bb
commit eeb8c22415

View File

@@ -193,9 +193,23 @@ func RepoOverview(ctx context.Context, arguments GitHubRepositoryArguments) (str
for _, content := range contents { for _, content := range contents {
switch content.Type { switch content.Type {
case "dir": case "dir":
directories = append(directories, content.Name) directories = append(directories, fmt.Sprintf(
"[%s](https://github.com/%s/%s/tree/%s/%s)",
content.Name,
arguments.Owner,
arguments.Repo,
repository.DefaultBranch,
content.Name,
))
case "file": case "file":
files = append(files, content.Name) files = append(files, fmt.Sprintf(
"[%s](https://raw.githubusercontent.com/%s/%s/refs/heads/%s/%s)",
content.Name,
arguments.Owner,
arguments.Repo,
repository.DefaultBranch,
content.Name,
))
} }
} }