envpath

package
v0.0.0-...-b872246 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PathStackEnv stores the string representation of the stack, as a ":" separated list.
	// Each element in the list is also the key to the env-var that stores the
	// nixEnvPath for that devbox-project. Except for the last element, which is InitPathEnv.
	PathStackEnv = "DEVBOX_PATH_STACK"

	// InitPathEnv stores the path prior to any synopkg.github.io/devboxellenv modifying the environment
	InitPathEnv = "DEVBOX_INIT_PATH"
)

Variables

This section is empty.

Functions

func JoinPathLists

func JoinPathLists(pathLists ...string) string

JoinPathLists joins and cleans PATH-style strings of os.ListSeparator delimited paths. To clean a path list, it splits it and does the following for each element:

  1. Applies filepath.Clean.
  2. Removes the path if it's relative (must begin with '/' and not be '.').
  3. Removes the path if it's a duplicate.

func Key

func Key(projectHash string) string

Key is the element stored in the stack for a devbox-project. It represents a pointer to the nixEnvPath value stored in its own env-var, also using this same Key.

func Stack

func Stack(env, originalEnv map[string]string) *stack

Stack initializes the path stack in the `env` environment. It relies on old state stored in the `originalEnv` environment.

Types

This section is empty.

Jump to

Keyboard shortcuts

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