Help us shape the future of Go! Take the 2026 Go Developer Survey

tag

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Create = app.Register(&app.Command[gitops.CreateFlags, app.Empty]{
	Use:    "tag {tag}",
	Desc:   "Create a tag and push to remote",
	Action: "Create",

	Prepare: gitops.PrepareCreate,

	Run: func(ctx *app.Context[gitops.CreateFlags, app.Empty]) error {
		tag := ctx.Arg(0)
		err := git.CreateTag(tag, git.Default)
		if err != nil {
			return errors.Trace(err, "create tag")
		}
		if !ctx.Flags.NoPush {
			err = git.PushTag(tag, ctx.Flags.Remote, false, git.Default)
			if err != nil {
				return errors.Trace(err, "push tag")
			}
		}
		return nil
	},
})
View Source
var Delete = app.Register(&app.Command[SelectFlag, app.Empty]{
	Use:    "tag {tag}",
	Desc:   "Delete a tag",
	Action: "Delete",

	Prepare: prepareSelect,

	Run: func(ctx *app.Context[SelectFlag, app.Empty]) error {
		tag, err := doSelect(ctx)
		if err != nil {
			return err
		}
		term.ConfirmExit("Do you want to delete tag %q", tag)
		err = git.DeleteTag(tag, git.Default)
		if err != nil {
			return err
		}
		return git.PushTag(tag, ctx.Flags.Remote, true, git.Default)
	},
})
View Source
var Switch = app.Register(&app.Command[SelectFlag, app.Empty]{
	Use:    "tag [tag]",
	Desc:   "Switch to a tag",
	Action: "Switch",

	Prepare: prepareSelect,

	Run: func(ctx *app.Context[SelectFlag, app.Empty]) error {
		tag, err := doSelect(ctx)
		if err != nil {
			return err
		}
		return git.Checkout(tag, false, git.Default)
	},
})

Functions

This section is empty.

Types

type SelectFlag

type SelectFlag struct {
	gitops.RemoteFlags
	gitops.FetchFlags
}

Jump to

Keyboard shortcuts

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