Documentation
¶
Overview ¶
Package mise bootstraps the mise binary and runs mise operations.
Index ¶
- Constants
- func CompareVersions(a, b string) int
- func GenerateConfig(plan *resolve.Plan) string
- func GenerateDotfiles(entries []resolve.DotfileEntry) string
- func GenerateTools(versions map[string]string) string
- type DotfileEntry
- type DotfilesStep
- type ExecMise
- type FakeRunner
- type HooksStep
- type InstallKind
- type Mise
- type Plan
- type Runner
- type ToolsStep
Constants ¶
const InstallerURL = "https://mise.run"
InstallerURL is the official mise installer.
const MinMiseVersion = "2025.1.0"
MinMiseVersion is the hardcoded minimum mise version required by dotdrift.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions compares calendar-style versions like 2026.6.6. Returns -1 if a < b, 0 if equal, 1 if a > b.
func GenerateConfig ¶
GenerateConfig emits a complete mise.toml with tools and dotfiles sections.
func GenerateDotfiles ¶
func GenerateDotfiles(entries []resolve.DotfileEntry) string
GenerateDotfiles emits a mise.toml [dotfiles] section from the resolved plan.
func GenerateTools ¶
GenerateTools emits a mise.toml [tools] section from the resolved plan.
Types ¶
type DotfileEntry ¶
DotfileEntry is a single resolved dotfile target.
type DotfilesStep ¶
DotfilesStep runs mise dotfiles apply for the dotfiles in the resolved plan.
func (*DotfilesStep) Name ¶
func (s *DotfilesStep) Name() string
type ExecMise ¶
type ExecMise struct {
// contains filtered or unexported fields
}
ExecMise wraps a Mise value so it can be used as a Runner by step code.
func NewExecMise ¶
NewExecMise creates a Runner backed by a Mise instance.
func (*ExecMise) DotfilesApply ¶
func (*ExecMise) EnsureAndInstall ¶
type FakeRunner ¶
FakeRunner records mise invocations for tests.
func (*FakeRunner) DotfilesApply ¶
func (f *FakeRunner) DotfilesApply(configPath string, yes bool) error
func (*FakeRunner) EnsureAndInstall ¶
func (f *FakeRunner) EnsureAndInstall(configPath string) error
type InstallKind ¶
type InstallKind int
InstallKind classifies how a mise binary is managed.
const ( InstallKindUnknown InstallKind = iota InstallKindSystemWide InstallKindUserManaged )
func ClassifyInstall ¶
func ClassifyInstall(path string) InstallKind
ClassifyInstall determines whether a mise binary is system-wide or user-managed.
System-wide (no auto-upgrade):
- DOTDRIFT_MISE_SYSTEM=1
- path under /usr/bin, /usr/local/bin, /bin, /sbin, /usr/sbin, /opt
- path under $HOME but not writable by the current user
User-managed (may auto-upgrade):
- path under $HOME and writable by the current user
func (InstallKind) String ¶
func (k InstallKind) String() string
type Mise ¶
type Mise struct {
LookPath func(string) (string, error)
Run func(string, ...string) (string, error)
Install func() (string, error)
Classify func(string) InstallKind
}
Mise finds, installs, or upgrades a mise binary.
func DefaultMise ¶
func DefaultMise() *Mise
DefaultMise returns a Mise configured with real OS dependencies.
type Plan ¶
type Plan struct {
Tools map[string]string
Dotfiles []DotfileEntry
}
Plan mirrors the parts of resolve.Plan needed for mise config generation.