util

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PkgEnv = func(pkg *Package) map[string]string {
		return map[string]string{
			"PACKAGE_ORIGIN":     pkg.Origin,
			"PACKAGE_VERSION":    pkg.Version,
			"PACKAGE_LATEST":     pkg.Latest,
			"PACKAGE_MAINTAINER": pkg.Maintainer,
			"PACKAGE_TYPE":       pkg.Type,
			"PACKAGE_DIR":        CleanPath(viper.GetString("base")) + pkg.Origin,
			"PACKAGE_ROOT":       CleanPath(viper.GetString("base")),
		}
	}
	SetPkgEnv = func(pkg *Package) {
		for k, v := range PkgEnv(pkg) {
			os.Setenv(k, v)
		}
	}
)

Functions

func CleanPath

func CleanPath(path string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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