~/bend-docscommunity

src/share/env.bend checks

raw source on the hub · import 0x886223f5c47e4983fe57d887c034bc7f/src/share/env.bend as Env

share/env: the environment ez hands to the programs it runs. Vendored packages live with the project rather than in ~/.bend/lib, so every bend ez starts has to be told where they are. Base has get_env and no set_env, and the one foreign effect execvp's what it is given, so the variable rides in front of the command as env BEND_LIB=... bend .... env is coreutils and is execvp'd like any other program, so no shell is involved.

2 imports
import Base
import ./args.bend as Args

Definitions

def or_else source · line 11 · raw

@+value:String -> @+alt:String -> String

a value, or the fallback when the variable was unset or empty

def var source · line 15 · raw

@name:String -> @+alt:String -> IO(String)

what a variable holds, with a default for when it holds nothing

def lib source · line 21 · raw

IO(String)

where this project's packages live

def line source · line 25 · raw

@at:String -> @args:List<&2, String> -> List<&2, String>

the command with the project's BEND_LIB in front of it

def dirs.build source · line 29 · raw

@build:Bool -> @bare:Bool -> List<&2, String>

the directory ez build writes into: bin when it was not told where

def dirs source · line 42 · raw

@+cmd:String -> @+out:String -> List<&2, String>

the directories bend writes into for a command and does not make itself: .ez for ez check's JS, and bin for ez build's default output. They are made just before bend starts, so a check or build that is refused makes none. Every other command makes what it writes into when it writes, and ez help, doctor and the rest write nothing here, so they leave a directory as they found it.