# dist-installer-cli

## File locations
- **Source:** `usr/bin/dist-installer-cli` -- make all changes here.
- **Standalone (autogenerated):** `usr/share/usability-misc/dist-installer-cli-standalone` -- do NOT edit. It is regenerated from the source script and sourced functions.

## Shell strictness
The script runs with `set -o nounset` (among other strict options). All variables must be initialized before use, even if they are only assigned conditionally later.

Common patterns to watch for:
- Variables only assigned inside `if`/`case` blocks but referenced unconditionally afterwards.
- Array variables (used with `${var[@]}`) that are never initialized to `()` on all code paths.
- Error-handling code referencing variables that may not yet be set (use `${var:-}` syntax).
- The `torify_conn_maybe()` function may return early without calling `set_transfer_proxy()`, so proxy-related variables must have defaults set in `get_transfer_cmd()`.
- Many external functions are `source`d from package `helper-scripts` (e.g., `get_os.sh`). Variables set by those functions are initialized inside them, not in this file.
