Help us shape the future of Go! Take the 2026 Go Developer Survey

dotfiles

package
v1.65.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnsurePrerequisites    = ensurePrerequisitesUnwired
	FindGitHubSSHKey       = findGitHubSSHKeyUnwired
	SetupSSHForGitHub      = setupSSHForGitHubUnwired
	HandleExistingRepo     = handleExistingRepo
	UpdateBareRepoWorktree = updateBareRepoWorktree
	FreshInstall           = freshInstall
	CloneBareRepo          = cloneBareRepo
	BackupConflicts        = backupConflicts
	CheckoutWorktree       = repo.CheckoutWorktree
	InitSubmodules         = repo.InitSubmodules
	ConfigureBareRepo      = repo.ConfigureBareRepo
	Stat                   = os.Stat
	EnsureSSH              = ensureSSHIfRequired
	SelectPrompt           = selectUnwired
	BareClone              = repo.BareClone
)

Test hooks and mockable dependencies

The workstation-setup hooks (EnsurePrerequisites, FindGitHubSSHKey, SetupSSHForGitHub) are wired by the command layer (cmd/setup wires EnsurePrerequisites, cmd/ssh wires the SSH hooks) to keep this package free of imports outside internal/. Their defaults fail loudly so an unwired composition surfaces immediately instead of silently skipping setup steps. Tests override them per-case.

View Source
var FetchRepo = func(ctx context.Context, repoPath, worktreePath string) error {
	return repo.FetchBareRepo(ctx, repoPath, worktreePath)
}
View Source
var PullRebaseRepo = func(ctx context.Context, repoPath, worktreePath string) error {
	return repo.PullRebaseBareRepo(ctx, repoPath, worktreePath)
}

pullRebaseRepo is a package-level variable used for testing.

View Source
var UpdateSubmodules = func(ctx context.Context, repoPath, worktreePath string) error {
	return repo.InitSubmodules(ctx, repoPath, worktreePath, nil)
}

Functions

func Install

func Install(ctx context.Context, opts InstallOptions) error

Install orchestrates the complete dotfiles installation workflow.

func SyncRepo

func SyncRepo(ctx context.Context, repoPath, worktreePath string, isVerbose bool) error

SyncRepo performs the fetch, pull-rebase, and submodule update operations for a bare repository.

Types

type InstallOptions added in v1.14.0

type InstallOptions struct {
	RepoURL      string
	Branch       string
	BareRepoPath string
	WorktreePath string
	Verbose      bool
}

InstallOptions holds configuration for installing dotfiles.

Jump to

Keyboard shortcuts

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