Documentation ¶
Index ¶
Constants ¶
const BinPath = HomePrefix + "/bin"
const HomePrefix = "/usr/local"
Variables ¶
var HomePath = filepath.Join(HomePrefix, "Fish")
var UserHomePath = os.Getenv("HOME")
Functions ¶
This section is empty.
Types ¶
type Food ¶
type Food struct { // The canonical name of the software. Name string // A (short) description of the software. Description string // The homepage URL for the software. Homepage string // Caveats inform the user about any Draft-specific caveats regarding this fish food. Caveats string // The version of the software. Version string // The list of binary distributions available for this fish food. Packages []*Package }
Food provides metadata to install a piece of software.
func (*Food) GetPackage ¶
GetPackage does a lookup for a package supporting the given os/arch. If none were found, this returns nil.
func (*Food) Installed ¶
Installed checks to see if this fish food is installed. This is actually just a check for if the directory exists and is not empty.
func (*Food) Linked ¶
Linked checks to see if a particular package owned by this fish food is linked to /usr/local/bin. This is just a check if the binaries symlinked in /usr/local/bin link back to the barrel.
type Home ¶
type Home string
Home designates where fish should store data.
func (Home) DefaultRig ¶
DefaultRig returns the path to the default fishing rig.
type Package ¶
type Package struct { // the running program's operating system target. One of darwin, linux, windows, and so on. OS string // the running program's architecture target. One of 386, amd64, arm, s390x, and so on. Arch string Resources []*Resource // The URL used to download the binary distribution for this version of the fish food. The file must be a gzipped tarball (.tar.gz) or a zipfile (.zip) for unpacking. URL string // Additional URLs for this version of the fish food. Mirrors []string // To verify the cached download's integrity and security, we verify the SHA-256 hash matches what we've declared in the fish food. SHA256 string }
Package provides metadata to install a piece of software on a given operating system and architecture.
type Resource ¶
type Resource struct { // Path is the path relative from the root of the unpacked archive to the resource. The resource is symlinked into the InstallPath and, if Executable is set, made executable (chmod +x). Path string // InstallPath is the destination path relative from /usr/local. The resource is symlinked from Path to the InstallPath and, if Executable is set, made executable (chmod +x). InstallPath string // Executable defines whether or not this resource should be made executable (chmod +x). This only applies for MacOS/Linux and can be ignored on Windows. Executable bool }