Replace canonical bootstrap and library-guard structures in shell files.
Source: target-root/usr/local/libexec/solidgroundux/normalize-canon.sh
Replace canonical bootstrap and library-guard structures in shell files.
Public functions
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_collect_cli_inputs | Preserve positional file and mask arguments as explicit runtime inputs while | - $@ — Original executable arguments. | — |
_get_parameters | Resolve the file or mask used for canonical normalization, using explicit | — | — |
_resolve_canon_files | Resolve and validate canonical fragment files. | — | — |
_detect_canonical_target | Determine which canonical structure a file contains. | - $1 — FILE | — |
_replace_framework_locator | Replace one locator function and its canonical header. | - $1 — FILE | — |
_replace_library_guard | Replace the complete Library guard section. | - $1 — FILE | — |
_expand_input | Expand one file path or glob mask. | - $1 — INPUT | Writes matching regular files, one per line. |
_normalize_file | Apply the appropriate canonical replacement to one file. | - $1 — FILE | — |
Description
Applies canonical SolidGroundUX structural fragments to one or more shell files. Files are classified from their contents: _framework_locator() identifies an executable bootstrap target, while _sgnd_lib_guard() identifies a source-only library or console module. Files containing neither target are skipped; files containing both are rejected.
Usage
Run the executable from its shell command (or installed wrapper):
normalize-canon /path/to/file.sh
normalize-canon '/path/to/project/**/*.sh'
normalize-canon '/path/to/project/usr/local/lib/**/*.sh'
Script-specific options:
--auto,-a: Run using command-line inputs or saved parameters.
