manifest

package
v0.0.0-...-0a12093 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMetadata

type ConfigMetadata struct {
	Author  string         `json:"author"`
	URL     string         `json:"url"`
	Branch  string         `json:"branch"`
	Targets []ConfigTarget `json:"targets"`
}

func ReadManifest

func ReadManifest(path string) (*ConfigMetadata, error)

NOTE: path should not include 'manifest.json'

func (*ConfigMetadata) AppendTarget

func (d *ConfigMetadata) AppendTarget(src, dst string)

NOTE: in this case src and dst refer to the source inside of the config repository, and the destination in the user's configuration files. For example, if I was storing my neovim config: src = "nvim" dst = "#hom/.config/nvim"

func (*ConfigMetadata) EmitManifest

func (d *ConfigMetadata) EmitManifest(path string) error

NOTE: path should point to the config DIRECTORY; it will create manifest.json on its own.

func (ConfigMetadata) ExpandTargets

func (d ConfigMetadata) ExpandTargets() []ConfigTarget

THIS IS ALMOST ALWAYS THE CORRECT WAY TO READ A MANIFEST'S TARGETS

func (d ConfigMetadata) Link(clobber bool) error

func (*ConfigMetadata) RemoveTarget

func (d *ConfigMetadata) RemoveTarget(base string)

RemoveTarget takes the basename of the target as it appears in the config repository.

func (d ConfigMetadata) Unlink() error

type ConfigTarget

type ConfigTarget struct {
	Src string `json:"src"`
	Dst string `json:"dst"`
}

func (ConfigTarget) String

func (t ConfigTarget) String() string

Jump to

Keyboard shortcuts

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