plan

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Path string
	Args []string
}

Command represents a command to run.

type Input

type Input struct {
	// RepoName
	RepoName string
	// RepoDir is where the git repo to modify lives. It will be copied into WorkDir
	RepoDir string
	// WorkDir is where we will store some results:
	//   - {WorkDir}/plan: stores a copy of repodir but with a new commit containing changes
	WorkDir string
	// Command to run
	Command Command
	// CommitMessage to send to `git commit -m`
	CommitMessage string
	// BranchName where the commit will be made
	BranchName string
	// Whether to display the diff of changes made
	Diff bool
}

Input for Plan

type Output

type Output struct {
	Success bool

	PlanDir       string
	GitDiff       string
	CommitMessage string
	BranchName    string
}

Output for Plan

func Plan

func Plan(ctx context.Context, input Input) (Output, error)

Plan creates a copy of the cloned repo and executes a command on it. This allows the user to preview a change to the repo.

Jump to

Keyboard shortcuts

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