apply

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package apply renders a theme variant against the port registry and installs the resulting files, running any reload hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecRunner

type ExecRunner struct{}

ExecRunner runs hooks through the system shell.

func (ExecRunner) Run

func (ExecRunner) Run(cmd string) error

Run executes cmd via `sh -c`.

type Report

type Report struct {
	Applied  []string
	Hooks    []string
	Warnings []string
}

Report summarises an apply run.

func Apply

func Apply(progs []ResolvedProgram, runner Runner, dryRun bool) (Report, error)

Apply writes each rendered program to its target and runs its hooks. When dryRun is true nothing is written. Hook failures are recorded as warnings rather than aborting the switch.

type ResolvedProgram

type ResolvedProgram struct {
	Name    string
	Target  string
	Content string
	Post    []string
	Known   bool
}

ResolvedProgram is a theme program rendered for a specific variant, with its destination path resolved to an absolute location.

func Render

func Render(t theme.Theme, v theme.Variant, paths config.Paths) ([]ResolvedProgram, error)

Render turns a theme's discovered program files into installable units for variant v: ${color.KEY} tokens are replaced from the variant palette, and each program's destination and reload hooks come from the registry (keyed by the program's port). A program whose port is not in the registry is an error, since lumos cannot know where its file belongs.

type Runner

type Runner interface {
	Run(cmd string) error
}

Runner executes a reload hook.

Jump to

Keyboard shortcuts

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