Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "browse PATH", Short: "Browse a repository", Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { rp := "." if len(args) > 0 { rp = args[0] } abs, err := filepath.Abs(rp) if err != nil { return err } r, err := git.Open(abs) if err != nil { return fmt.Errorf("failed to open repository: %w", err) } output := lipgloss.DefaultRenderer() ctx := cmd.Context() c := common.NewCommon(ctx, output, 0, 0) c.HideCloneCmd = true comps := []common.TabComponent{ repo.NewReadme(c), repo.NewFiles(c), repo.NewLog(c), } if !r.IsBare { comps = append(comps, repo.NewStash(c)) } comps = append(comps, repo.NewRefs(c, git.RefsHeads), repo.NewRefs(c, git.RefsTags)) m := &model{ model: repo.New(c, comps...), repo: repository{r}, common: c, } m.footer = footer.New(c, m) p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion(), ) _, err = p.Run() return err }, }
Command is the browse command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.