Documentation
¶
Overview ¶
Package paru implements the dotdrift mise package-plugin backend for the `paru` manager (pacman + AUR). The dotdrift paru subcommand exposes two operations — installed (status check) and install — that the Lua plugin shim delegates to. This keeps all paru invocation logic in Go.
Index ¶
- func EnsureInstalled(misePluginsDir, name string) (bool, error)
- func FormatStatus(states []State) string
- func Install(ctx context.Context, runner Runner, names []string, dryRun, update bool) error
- func InstallArgs(names []string, dryRun, update bool) []string
- func WritePlugin(dir string) error
- type ExecRunner
- type Runner
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureInstalled ¶ added in v0.13.0
EnsureInstalled copies the embedded paru plugin into mise's plugin registry (misePluginsDir/name) as real files — the same on-disk shape as any other mise plugin, no symlink — but performs no writes on the common path. It hashes the installed plugin and compares to the embedded plugin's hash, recopying (remove + rewrite) only on mismatch, a missing plugin, or when the target is a symlink (a stale shape left by an older dotdrift). Call on every Arch apply; returns true when it wrote.
func FormatStatus ¶
FormatStatus emits the line-based protocol consumed by the Lua plugin shim: one line per package, tab-separated: name<TAB>installed|missing<TAB>version.
func Install ¶
Install runs `paru -S --needed --noconfirm <names>`. paru self-elevates (calls sudo pacman internally); this function invokes no sudo itself.
func InstallArgs ¶
InstallArgs builds the argv for installing packages via paru.
func WritePlugin ¶
WritePlugin writes the embedded paru plugin into dir, preserving its layout. Creates directories as needed; overwrites existing files (content is deterministic — same embed, same bytes).
Types ¶
type Runner ¶
Runner executes one command and returns its stdout (trimmed) on success or the combined output on failure.
type State ¶
State is one element of the installed-status response.
func PackageStatus ¶
PackageStatus checks each package via `pacman -Q <name>`. The query is read-only and never elevates. A package present in pacman's local database (covering both repo and AUR packages) is "installed"; anything else is "missing". Errors from individual queries are tolerated (treated as missing) so one bad name never blocks the batch.