~/bend-docscommunity

src/ez/start.bend checks

raw source on the hub · import 0x74799d3f846634a3d7461d4336d7c9d4/src/ez/start.bend as Start

ez/start: what ez check, ez build and ez run start, decided from the ledger they read and the words they were given. Each starts one bend on the entry the ledger names, or refuses and starts nothing when there is no ez.toml or it does not parse, as cargo refuses a directory with no Cargo.toml. The interpreter (ez/cmd.bend) reads ez.toml, puts the project's BEND_LIB in front of the line (Env.line), runs it and exits; that it does so faithfully is EZ-TRUST-2.

3 imports
import Base
import ../ledger/manifest.bend as M
import ../share/args.bend as Args

Types

type Ask source · line 14 · raw

Data

which of the three commands is asking, with what it was told: where a build goes, and every word of the line for a run

type Start source · line 21 · raw

Data

what a command does: refuse with a reason, having started nothing, or start bend with this line

Definitions

def does source · line 26 · raw

@ask:Ask -> String

what each command is for, in the words a refusal says it with

def none source · line 36 · raw

@ask:Ask -> String

why a directory with no ez.toml is refused

def entry.or source · line 40 · raw

@+file:String -> String

the entry file a ledger names, or "main.bend" when it names none

def entry source · line 44 · raw

@ledger:0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Manifest -> String

the entry file of a ledger that parsed

def named source · line 49 · raw

@ledger:0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Manifest -> String

the name a ledger that parsed gives the package

def build.named source · line 57 · raw

@+name:String -> String

where a build lands when nothing said: bin/<package name>.out. The name and not the entry file, because the entry is where a program starts and the name is what it is called: a package named bolt with its entry at bolt/main.bend builds bin/bolt.out and not bin/main.out.

def build.out source · line 61 · raw

@+at:String -> @+name:String -> String

where a build lands: what was asked for, or the default

def line source · line 67 · raw

@ask:Ask -> @+ledger:0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Manifest -> List<&2, String>

the line each command starts bend with, over a ledger that parsed: the entry checked into .ez/check.js and never run, built to a native binary, or run with every word after run (EZ-TOOL-9)

def read source · line 77 · raw

@+ask:Ask -> @ledger:0x74799d3f846634a3d7461d4336d7c9d4/src/ledger/manifest.Read -> Start

what a command does with the ledger it read

def start source · line 85 · raw

@+ask:Ask -> @text:Maybe<&2, String> -> Start

what a command does with ez.toml's text, None when there is none

def code source · line 96 · raw

@start:Start -> @program:U32 -> U32

the status ez run exits with, given the status of the program it started (EZ-OUT-1): 1 for a refusal, which started none, and the program's own status otherwise, as cargo run exits. ez check and ez build end on what bend printed instead (ez/ends.bend).

def why source · line 104 · raw

@start:Start -> String

why a command refused, or "" when it started bend