Initialize framework environment variables and directory structure
Source: target-root/usr/local/lib/solidgroundux/common/sgnd-bootstrap-env.sh
Initialize framework environment variables and directory structure
Public functions
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_sgnd_lib_guard | Ensure direct execution is rejected and record that the library has been sourced. | — | — |
_build_framework_dirs | Rebuild the directory specification list used by sgnd_ensure_dirs. | — | — |
Description
Establishes the runtime environment for SolidGroundUX scripts.
The library:
- Defines and initializes core framework directories
- Resolves system and user paths (config, state, logs, etc.)
- Ensures required directories exist with proper permissions
- Applies default values for environment variables when unset
- Normalizes environment behavior across different execution contexts
Design principles
- Deterministic environment setup regardless of execution context
- A single self-locating framework root for all framework-managed filesystem paths
- Safe defaults with minimal assumptions about host system
- Idempotent setup (safe to run multiple times)
Role in framework
- Core bootstrap layer responsible for environment initialization
- Runs early in the bootstrap process before other libraries depend on it
- Provides foundational paths and variables used across all modules
Non-goals
- Argument parsing (handled by sgnd-args.sh)
- Configuration loading (handled by sgnd-cfg.sh)
- UI or user interaction
Runtime directory metadata
Framework directory specifications
var: SGND_FRAMEWORK_DIRS
Purpose
Hold the rebuilt path specification list consumed by sgnd_ensure_dirs.
Format: s|/path system-owned directory. u|/path user-owned directory.
