Expand description
Common utility functions — color-aware output, command existence checks, print helpers.
Ports functionality from scripts/common_utils.sh:
- Color constants that auto-disable for non-TTY and
NO_COLOR command_exists()utility function- Print helpers (header, section, step, success, warning, error)
§Validation Assertions
- VAL-INFRA-016: Color-aware output auto-disabling for non-TTY, command_exists utility
Structs§
- Colors
- ANSI color constants that auto-disable for non-TTY and
NO_COLOR.
Enums§
- PipCache
FixResult - Result of fixing pip cache directory ownership.
- Python
PkgManager - Detected Python package manager.
Functions§
- color_
enabled - Determine if color output should be used.
- command_
exists - Check if a command exists in the system PATH.
- detect_
python_ pkg_ manager - Detect the available Python package manager.
- execute_
command - Execute a command with dry-run support.
- fix_
pip_ cache_ ownership - Fix ownership of the pip cache directory (
~/.cache/pip). - get_
colors - Get the appropriate color constants based on terminal capabilities.
- pip_
install_ prefix - Build a pip install command prefix using the detected package manager.
- print_
error - Print an error message to stderr.
- print_
header - Print a formatted header box to stderr.
- print_
section - Print a section separator to stderr.
- print_
step - Print a step indicator to stderr.
- print_
success - Print a success message to stderr.
- print_
warning - Print a warning message to stderr.
- resolve_
rocminfo_ path - Resolve the full path to the
rocminfobinary. - resolve_
rocprofiler_ tool_ path - Resolve the path to the ROCm rocprofiler SDK tool library.