latest_commit

package
v0.88.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "latest-commit <user>/<repo>",
	Short:   "Get latest commit of a repository",
	Aliases: []string{"lc"},
	Args:    cobra.ExactArgs(1),
	RunE: func(c *cobra.Command, args []string) error {
		argS := strings.Split(args[0], "/")
		if len(argS) != 2 {
			return fmt.Errorf("invalid argument: %s, required format is <user>/<repo>", args[0])
		}
		commit, err := github_utils.GetLatestCommitE(argS[0], argS[1])
		if err != nil {
			log.Fatal(err)
		}

		if FlagShort {
			commit = commit[:7]
		}

		fmt.Println(commit)
		return nil
	},
}
View Source
var FlagShort bool

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL