env

package
v0.0.0-...-ef90cfb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package env captures details about the distri environment. Inspect the environment using `distri env`.

Index

Constants

This section is empty.

Variables

View Source
var DefaultRepo = func() string {
	if env := os.Getenv("DEFAULTREPO"); env != "" {
		return env
	}
	return join(DefaultRepoRoot, "pkg")
}()

DefaultRepo is the default repository path or URL to pkg/.

View Source
var DefaultRepoRoot = func() string {
	if env := os.Getenv("DEFAULTREPOROOT"); env != "" {
		return env
	}
	return DistriRoot.BuildDir("distri")
}()

DefaultRepoRoot is the default repository path or URL.

View Source
var DistriConfig = func() string {
	if env := os.Getenv("DISTRICFG"); env != "" {
		return env
	}
	return "/etc/distri"
}()

DistriConfig is the directory containing distri config files (typically /etc/distri).

View Source
var DistriRoot = func() DistriRootDir {
	if env := os.Getenv("DISTRIROOT"); env != "" {
		return DistriRootDir(env)
	}

	return DistriRootDir(os.ExpandEnv("$HOME/distri"))
}()

Functions

func Repos

func Repos() ([]distri.Repo, error)

Repos returns all configured repositories by consulting DistriConfig. It is a function to avoid I/O for invocations which don’t need to deal with repositories.

Types

type DistriRootDir

type DistriRootDir string

DistriRoot is the root directory of where the distri repository was checked out.

func (*DistriRootDir) BuildDir

func (d *DistriRootDir) BuildDir(pkg string) string

func (*DistriRootDir) PkgDir

func (d *DistriRootDir) PkgDir(pkg string) string

Jump to

Keyboard shortcuts

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