manifest

package
v0.0.0-...-72dcd91 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 4 Imported by: 0

README

Scoob Manifest

This directory hosts the code for the scoop manifest parser

Spec: https://github.com/ScoopInstaller/Scoop/wiki/App-Manifests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch

type Arch struct {
	Bin         Bin                `json:"bin"`
	Installer   Installer          `json:"installer"`
	Uninstaller Installer          `json:"uninstaller"`
	Hash        Vectorized[string] `json:"hash"`
	Url         Vectorized[string] `json:"url"`
	Extract_dir string             `json:"extract_dir"`
	Extract_to  string             `json:"extract_to"`
	Shortcuts   [][]string         `json:"shortcuts"`
}

info about a single architecture

type Bin

type Bin [][]string

The bin key this can be one of the following:

  • a string
  • a slice of strings
  • a slice of (slice of strings)

func (*Bin) UnmarshalJSON

func (b *Bin) UnmarshalJSON(data []byte) error

type Installer

type Installer struct {
	File   string             `json:"file"` // for installer, defaults to url, required for uninstaller
	Script Vectorized[string] `json:"script"`
	Args   Vectorized[string] `json:"args"`
	Keep   string             `json:"keep"` // "true" (string, not bool) to keep file, else remove. Ignored for uninstaller
}

The `installer` used in Installer key and Uninstaller

type License

type License struct {
	Identifier string `json:"identifier"`
	Url        string `json:"url"`
}

a license struct If license was only a string, we populate the identifier field, else if both were give, we use

func (*License) UnmarshalJSON

func (l *License) UnmarshalJSON(data []byte) error

type Manifest

type Manifest struct {
	Version        string              `json:"version"`
	Homepage       string              `json:"homepage"`
	Description    string              `json:"description"`
	Extract_dir    string              `json:"extract_dir"`
	Extract_to     string              `json:"extract_to"`
	Env_add_path   string              `json:"env_add_path"`
	Innosetup      bool                `json:"innosetup"`
	Shortcuts      [][]string          `json:"shortcuts"`
	Suggest        map[string][]string `json:"suggest"`
	Env_set        map[string]string   `json:"env_set"`
	Architecture   map[string]Arch     `json:"architecture"`
	Url            Vectorized[string]  `json:"url"`
	Hash           Vectorized[string]  `json:"hash"`
	Notes          Vectorized[string]  `json:"notes"`
	Persist        Vectorized[string]  `json:"persist"`
	Post_install   Vectorized[string]  `json:"post_install"`
	Post_uninstall Vectorized[string]  `json:"post_uninstall"`
	Pre_install    Vectorized[string]  `json:"pre_install"`
	Pre_uninstall  Vectorized[string]  `json:"pre_uninstall"`
	License        License             `json:"License"`
	Bin            Bin                 `json:"bin"`
	Installer      Installer           `json:"installer"`
	Uninstaller    Installer           `json:"uninstaller"`
}

A struct representing a scoob manifest

func Parse

func Parse(file string) (Manifest, error)

parse a manifest file

type Vectorized

type Vectorized[T any] []T

A type that can be either `T` or a slice of `T`. This will be unmarshalled into a slice of `T`

func (*Vectorized[T]) UnmarshalJSON

func (t *Vectorized[T]) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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