gitea-runner: fix log_info/warn/error writing to stdout, corrupting TEMPLATE
log_info() etc. wrote to stdout, unlike openbao's identical functions which write to stderr specifically so $(fn) capture is safe. lib/common.sh's detect_latest_alpine_template() does `log_info "Selected..."; echo "$tmpl"` — in gitea-runner, TEMPLATE=$(detect_latest_alpine_template) therefore captured the log line and ANSI codes along with the template name, breaking both the pveam list lookup and pct create's template argument.
This commit is contained in:
@@ -28,9 +28,10 @@ GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m'
|
||||
|
||||
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
|
||||
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
|
||||
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
|
||||
# Logs go to stderr so callers can safely use $(fn) without capturing log noise.
|
||||
log_info() { echo -e "${GREEN}[INFO]${NC} $1" >&2; }
|
||||
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1" >&2; }
|
||||
log_error() { echo -e "${RED}[ERROR]${NC} $1" >&2; }
|
||||
|
||||
require_root() {
|
||||
if [[ "$(id -u)" -ne 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user