vcs

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package vcs holds the git/copy helpers shared by the plugin and skill installers. The functions are package-level vars so tests can inject fakes.

Index

Constants

This section is empty.

Variables

View Source
var Clone = func(url, ref, dest string) error {
	args := []string{"clone", "--depth", "1"}
	if ref != "" {
		args = append(args, "--branch", ref)
	}
	args = append(args, url, dest)
	cmd := exec.Command("git", args...)
	cmd.Stderr = os.Stderr
	return cmd.Run()
}

Clone clones url (optionally at ref) into dest. Var for test injection.

View Source
var Pull = func(dir string) error {
	cmd := exec.Command("git", "-C", dir, "pull", "--ff-only")
	cmd.Stderr = os.Stderr
	return cmd.Run()
}

Pull fast-forwards an existing checkout. Var for test injection.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies the contents of src into dst (which must already exist), skipping any .git directory and preserving file permission bits (so hook/skill scripts stay executable). Used to install from a local directory without requiring it to be a git repository.

Types

This section is empty.

Jump to

Keyboard shortcuts

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