source

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 source installs and updates theme bundles from git repositories, local folders or local .zip files. Installed themes are always stored as <slug>.zip in the themes directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Install

func Install(spec, themesDir string, cloner Cloner) ([]string, error)

Install installs the theme bundle(s) referenced by spec — a local .zip file, a bundle directory, a folder of bundles, or a git repository — into themesDir as <slug>.zip, recording each theme's origin. It returns the installed slugs.

func NormalizeGitURL

func NormalizeGitURL(spec string) string

NormalizeGitURL accepts the shorthand forms lumos supports and returns a URL git can clone. A bare "owner/repo" is assumed to be on GitHub.

func Update

func Update(name, themesDir string, cloner Cloner) error

Update refreshes one theme by slug, or all installed themes when name is empty, by re-fetching from each theme's recorded origin.

Types

type Cloner

type Cloner interface {
	Clone(url, dest string) error
}

Cloner fetches a git repository into a directory. It is an interface so install/update can be tested without network access.

type GitCloner

type GitCloner struct{}

GitCloner shells out to the system git binary.

func (GitCloner) Clone

func (GitCloner) Clone(url, dest string) error

Clone runs `git clone --depth 1 url dest`.

Jump to

Keyboard shortcuts

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