Documentation
¶
Overview ¶
Package orbinit scaffolds a new orb project for "circleci orb init". It downloads the CircleCI Orb-Template repository, extracts it, rewrites the template placeholders, and initializes a local git repository. It performs no CircleCI API calls; the orb command layer owns those.
Index ¶
- func ApplyTemplate(orbPath, projectName, org, orbName, namespace string) error
- func CheckoutAlpha(w *git.Worktree) error
- func FetchTemplate(ctx context.Context, orbPath string) (err error)
- func InitRepo(orbPath, remoteURL, branch string) (*git.Repository, *git.Worktree, error)
- func ProjectNameFromRemote(remoteURL string) string
- func RemovePrivateLicense(orbPath string) error
- func Substitute(contents, projectName, org, orbName, namespace string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTemplate ¶
ApplyTemplate rewrites the placeholder tokens in every template file under orbPath with the given project details.
func CheckoutAlpha ¶
CheckoutAlpha creates and switches to the "alpha" branch.
func FetchTemplate ¶
FetchTemplate downloads the latest release of the orb template repository and extracts it into orbPath. The GitHub zipball nests everything under a top-level directory; that wrapper directory is stripped during extraction so the template lands directly in orbPath.
func InitRepo ¶
InitRepo initializes a git repository at orbPath, adds an "origin" remote pointing at remoteURL, tracks branch, stages all files, and creates an initial commit. It returns the repository and its worktree.
func ProjectNameFromRemote ¶
ProjectNameFromRemote derives a project name from a git remote URL by taking the last path segment and trimming any ".git" suffix.
func RemovePrivateLicense ¶
RemovePrivateLicense deletes the MIT LICENSE file from a private orb project. A missing file is not an error.
func Substitute ¶
Substitute replaces the orb template placeholder tokens in a file's contents.
Types ¶
This section is empty.