BEGINconstconst BEGIN: "# >>> ergonex >>>"The line that begins the block.
The one marked block of a start-up file (commons 0003-host FR-019): ergonex shell install writes a block between the lines # >>> ergonex >>> and # <<< ergonex <<<, leaves one block where it is run twice, and --uninstall removes exactly that block and nothing else, so that a file that had other text is, after both, as it was.
Pure: these are functions from the file's text to its new text; the host layer reads the file, shows the diff, asks and writes. The block is appended at the end of the file with no blank line of its own, so that removing it removes nothing the person wrote; where the file did not end in a newline, one is added before the block and stays after it is removed. A file that uses CRLF gets a block that uses CRLF. A block with a begin and no end is refused rather than guessed at. A file that does not exist is not made (0003-host FR-026): installBlock refuses it as absent, and the command says how the person creates it.
BEGINconstconst BEGIN: "# >>> ergonex >>>"The line that begins the block.
ENDconstconst END: "# <<< ergonex <<<"The line that ends the block.
installBlockfunctionfunction installBlock(existing: string | undefined, snippet: string): Result<Edit, BlockError>The file after the block is installed: appended where there is none, replaced where one is there (so that the snippet is the current one), and one only where several are. existing is the file's text, or undefined where there is no file, which is refused as absent: a start-up file is never created (0003-host FR-026).
removeBlockfunctionfunction removeBlock(existing: string): Result<Edit, BlockError>The file after every block is removed, with exactly the lines of the blocks and nothing else; unchanged where there is none.