orbinit

package
v1.0.45159-pre Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 16 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(orbPath, projectName, org, orbName, namespace string) error

ApplyTemplate rewrites the placeholder tokens in every template file under orbPath with the given project details.

func CheckoutAlpha

func CheckoutAlpha(w *git.Worktree) error

CheckoutAlpha creates and switches to the "alpha" branch.

func FetchTemplate

func FetchTemplate(ctx context.Context, orbPath string) (err error)

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

func InitRepo(orbPath, remoteURL, branch string) (*git.Repository, *git.Worktree, error)

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

func ProjectNameFromRemote(remoteURL string) string

ProjectNameFromRemote derives a project name from a git remote URL by taking the last path segment and trimming any ".git" suffix.

func RemovePrivateLicense

func RemovePrivateLicense(orbPath string) error

RemovePrivateLicense deletes the MIT LICENSE file from a private orb project. A missing file is not an error.

func Substitute

func Substitute(contents, projectName, org, orbName, namespace string) string

Substitute replaces the orb template placeholder tokens in a file's contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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