Documentation
¶
Overview ¶
Package clonenext — github.go checks and creates GitHub repositories.
Index ¶
- Variables
- func CreateRepo(owner, repoName string, private bool) error
- func LoadBatchFromCSV(path string) ([]string, error)
- func ParseOwnerRepo(remoteURL string) (string, string, error)
- func ReplaceRepoInURL(remoteURL, currentRepo, targetRepo string) string
- func RepoExists(owner, repo string) (bool, error)
- func ResolveTarget(parsed ParsedRepo, arg string) (int, error)
- func TargetRepoName(baseName string, version int) string
- func WalkBatchFromDir(root string) ([]string, error)
- type ParsedRepo
Constants ¶
This section is empty.
Variables ¶
var ErrBatchEmpty = errors.New("clonenext: batch input contained no repos")
ErrBatchEmpty is returned when neither the CSV nor the cwd walk yielded any candidate repos. Callers surface this as a soft warning, not a crash.
Functions ¶
func CreateRepo ¶
CreateRepo creates a new GitHub repository under the given owner. It detects whether the owner is a user or organization and calls the appropriate endpoint. The repo is created as private by default.
func LoadBatchFromCSV ¶
LoadBatchFromCSV reads a CSV file and returns one absolute repo path per non-empty data row. See the package doc-comment for the full parsing contract (BOM, line endings, header detection, optional columns).
func ParseOwnerRepo ¶
ParseOwnerRepo extracts owner and repo name from a GitHub remote URL. Supports both HTTPS and SSH formats.
func ReplaceRepoInURL ¶
ReplaceRepoInURL swaps the repo name in a remote URL.
func RepoExists ¶
RepoExists checks whether a GitHub repository exists via the API. Returns true if the repo responds with 200, false on 404, error otherwise.
func ResolveTarget ¶
func ResolveTarget(parsed ParsedRepo, arg string) (int, error)
ResolveTarget computes the target version from a version argument. "v++" → current + 1 "v+1" → current + 1 (alias) "v15" → 15
func TargetRepoName ¶
TargetRepoName builds the full repo name for the target version.
func WalkBatchFromDir ¶
WalkBatchFromDir returns every immediate subdirectory of root that is itself a git repository (i.e. contains a `.git` entry).
Types ¶
type ParsedRepo ¶
ParsedRepo holds the decomposed parts of a versioned repo name.
func ParseRepoName ¶
func ParseRepoName(name string) ParsedRepo
ParseRepoName extracts the base name and version from a repo name. "macro-ahk-v11" → ("macro-ahk", 11, true) "macro-ahk" → ("macro-ahk", 1, false)