mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
Shell library (mock_val/lib/shell/):
- Delete prole_cmd.sh, prole_env.sh, prole_guardrails.sh,
prole_secrets.sh, prole_string.sh, prole_yaml.sh
- Add knoe_* equivalents with same functionality
Config tooling:
- Delete mock_val/prole_cfg.sh, mock_val/sync-prole-cfg.py
- Add mock_val/knoe_cfg.sh, mock_val/sync-knoe-cfg.py
Mirrors the broader prole → knoe project rename.
Co-authored-by: Junie <junie@jetbrains.com>
20 lines
397 B
Bash
20 lines
397 B
Bash
#!/usr/bin/env bash
|
|
|
|
knoe_trim() {
|
|
local s="${1:-}"
|
|
# Trim leading/trailing whitespace without invoking external tools.
|
|
s="${s#${s%%[![:space:]]*}}"
|
|
s="${s%${s##*[![:space:]]}}"
|
|
printf '%s' "$s"
|
|
}
|
|
|
|
knoe_normalize_realm() {
|
|
local realm
|
|
realm=$(knoe_trim "${1:-}")
|
|
if [[ -z "$realm" ]]; then
|
|
printf '%s' ""
|
|
return 0
|
|
fi
|
|
printf '%s' "$realm" | tr '[:lower:]' '[:upper:]'
|
|
}
|