Revert "Fix lint issues and improve test suite resilience"

This reverts commit 90d44bd3bc.
This commit is contained in:
stevensting
2026-07-21 16:09:11 +02:00
parent a2bf10a442
commit 5d891c88c7
16 changed files with 52 additions and 132 deletions
+14 -7
View File
@@ -11,20 +11,27 @@ gomplate="${GOMPLATE_BIN:-gomplate}"
# Ensure gomplate is installed before running template tests
require_gomplate() {
if ! command -v "$gomplate" &>/dev/null; then
echo " SKIP gomplate not found (install from https://github.com/hairyhenderson/gomplate or set GOMPLATE_BIN)"
exit 0
echo "gomplate not found. Install it from https://github.com/hairyhenderson/gomplate"
echo "or set GOMPLATE_BIN env var."
exit 1
fi
}
render() {
local tmpl=$1 envfile=$2
"$gomplate" \
--template t="$tmpl" \
--context "_=fmt:%s" \
--datasource "env=env://?$envfile" \
-f "$tmpl" 2>/dev/null
}
# Render a template by exporting env vars directly
# This avoids gomplate datasource quirks with .env files
render_via_env() {
local tmpl=$1 envfile=$2
set -a
# shellcheck disable=1090,1091
. "$envfile"
set +a
"$gomplate" -f "$tmpl" 2>/dev/null
# shellcheck disable=2046
env $(xargs < "$envfile") "$gomplate" -f "$tmpl" 2>/dev/null
}
# ---------------------------------------------------------------------------