mounts

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mounts implements the mounts apply step: activation of systemd mount units whose unit files are already placed by mise. This step never writes unit files — placement is mise's job; it only runs mkdir for the destinations and systemctl for activation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecRunner

type ExecRunner struct {
	Verbose bool
	// Out/Err are the Verbose streaming destinations; nil defaults to
	// os.Stdout/os.Stderr.
	Out io.Writer
	Err io.Writer
}

ExecRunner runs commands via exec.CommandContext. Verbose streams child stdout/stderr live to Out/Err while still capturing and echoes each command line set -x-style ("+ argv") to Err before it runs, so failure errors keep their output suffix.

func (ExecRunner) Run

func (r ExecRunner) Run(ctx context.Context, argv []string) error

Run executes argv[0] with argv[1:], returning the combined output on failure so callers can log systemctl's own diagnostics (e.g. "not loaded"). In Verbose mode the output also streams live (MultiWriter) and the command line is echoed set -x-style ("+ argv") to Err immediately before execution, so the error contract is unchanged.

func (*ExecRunner) SetVerbose added in v0.5.0

func (r *ExecRunner) SetVerbose(v bool)

SetVerbose toggles live output streaming.

type Runner

type Runner interface {
	Run(ctx context.Context, argv []string) error
}

Runner executes one privileged command argv.

type Step

type Step struct {
	Runner Runner
	Plan   resolve.MountsStep
}

Step activates the mount units of a resolved plan: it creates every destination directory, reloads systemd once so it picks up the unit files mise placed, then enables (or disables) each mount unit — plus its timer unit when the entry declares StartAt.

func (*Step) Name

func (s *Step) Name() string

Name returns the pipeline step name.

func (*Step) Run

func (s *Step) Run(ctx context.Context) error

Run executes the mounts step. An empty plan is a no-op success.

Jump to

Keyboard shortcuts

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