fish

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

README

Fish, The Package Manager

Features, usage and installation instructions can be found in the documentation.

What does Fish do?

Fish is a cross-platform systems package manager, bringing the ease of use of Homebrew to Linux and Windows.

$ fish install helm
==> Installing helm...
🐠  helm 2.8.2: installed in 1.462258159s

Fish works across all three major operating systems (Windows, MacOS, and Linux). It installs packages into its own directory and symlinks their files into /usr/local (or C:\ProgramData for Windows). You can think of it as the cross-platform Homebrew.

Fish takes the ideas of Homebrew Formulas to the next level by installing pre-packaged tools. Fish food are simple Lua scripts:

local name = "helm"
local version = "2.8.2"

food = {
    name = name,
    description = "The Kubernetes Package Manager",
    homepage = "https://github.com/kubernetes/helm",
    version = version,
    packages = {
        {
            os = "darwin",
            arch = "amd64",
            url = "https://storage.googleapis.com/kubernetes-helm/helm-v" .. version .. "-darwin-amd64.tar.gz",
            sha256 = "a0a8cf462080b2bc391f38b7cf617618b189cdef9f071c06fa0068c2418cc413",
            resources = {
                {
                    path = "darwin-amd64/" .. name,
                    installpath = "bin/" .. name,
                    executable = true
                }
            }
        },
        {
            os = "linux",
            arch = "amd64",
            url = "https://storage.googleapis.com/kubernetes-helm/helm-v" .. version .. "-linux-amd64.tar.gz",
            sha256 = "614b5ac79de4336b37c9b26d528c6f2b94ee6ccacb94b0f4b8d9583a8dd122d3",
            resources = {
                {
                    path = "linux-amd64/" .. name,
                    installpath = "bin/" .. name,
                    executable = true
                }
            }
        },
        {
            os = "windows",
            arch = "amd64",
            url = "https://storage.googleapis.com/kubernetes-helm/helm-v" .. version .. "-windows-amd64.tar.gz",
            sha256 = "cb6ea5d60f202c752f1f0777e4bebd98c619a2c18e52468df7a302e783216f23",
            resources = {
                {
                    path = "windows-amd64\\" .. name .. ".exe",
                    installpath = "bin\\" .. name .. ".exe"
                }
            }
        }
    }
}

Troubleshooting

For troubleshooting, see the Troubleshooting Guide.

Security

Please email security issues to mailto:matt.fisher+security-issues@fishworks.io.

License

Fish is licensed under the Apache v2 License.

Documentation

Index

Constants

View Source
const BinPath = HomePrefix + "\\bin"
View Source
const HomePrefix = "C:\\ProgramData"

Variables

View Source
var HomePath = filepath.Join(HomePrefix, "Fish")
View Source
var UserHomePath = homedir()

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

func (f *Food) GetPackage(os, arch string) *Package

GetPackage does a lookup for a package supporting the given os/arch. If none were found, this returns nil.

func (*Food) Install

func (f *Food) Install() error

Install attempts to install the package, returning errors if it fails.

func (*Food) Installed

func (f *Food) Installed() bool

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 (f *Food) Link(pkg *Package) error

func (*Food) Linked

func (f *Food) Linked() bool

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.

func (*Food) Uninstall

func (f *Food) Uninstall() error

Uninstall attempts to uninstall the package, returning errors if it fails.

func (f *Food) Unlink(pkg *Package) error

type Home

type Home string

Home designates where fish should store data.

func (Home) Barrel

func (h Home) Barrel() string

Barrel returns the path to the fish barrel.

func (Home) DefaultRig

func (h Home) DefaultRig() string

DefaultRig returns the path to the default fishing rig.

func (Home) Path

func (h Home) Path(elem ...string) string

Path returns Home with elements appended.

func (Home) Rigs

func (h Home) Rigs() string

Rigs returns the path to the fishing rigs.

func (Home) String

func (h Home) String() string

String returns Home as a string.

Implements fmt.Stringer.

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
}

type UserHome

type UserHome string

UserHome designates the current user's home directory.

func (UserHome) Cache

func (h UserHome) Cache() string

Cache returns the path to the cache.

func (UserHome) Path

func (h UserHome) Path(elem ...string) string

Path returns Home with elements appended.

func (UserHome) String

func (h UserHome) String() string

String returns Home as a string.

Implements fmt.Stringer.

Directories

Path Synopsis
cmd
pkg
rig

Jump to

Keyboard shortcuts

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