stage: lib file

This commit is contained in:
Jamie Albert
2025-11-01 02:36:34 +00:00
parent 146ca6a7c7
commit 2e2c1a77f7

29
libs/lib_output.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# ---
# @file_name: jalibs.sh
# @version: 1.0.0
# @description: lib files
# @author: Jamie Albert (empty_produce)
# @author_contact: <mailto:empty.produce@flatmail.me>
# @license: GNU Affero General Public License v3.0 (Included in LICENSE)
# Copyright (C) 2025, Jamie Albert
# ---
set -euo pipefail
# ---
# Output
# ---
text::error() {
declare error_msg exit_code="$1"
shift
printf -v error_msg 'error[%d]: %s\n' "$exit_code" "$*"
printf '%s' "$error_msg" >&2
exit "${exit_code}"
}
text::info() {
declare info_msg
printf -v info_msg '%s\n' "$*"
printf '%s' "$info_msg"
}