Skip to content

Commit e73975f

Browse files
CopilotPDowney
andauthored
Fix bash 4.0+ lowercase expansion and tail memory usage in run-install-step.sh
Agent-Logs-Url: https://github.com/EngineScript/EngineScript/sessions/0d576514-9822-4195-bf71-b935169e5fdf Co-authored-by: PDowney <11467177+PDowney@users.noreply.github.com>
1 parent 8ddbd05 commit e73975f

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ Changes are organized by date, with the most recent changes listed first.
66

77
## 2026-04-10
88

9+
### 🔧 CI SCRIPT PORTABILITY AND MEMORY IMPROVEMENTS
10+
11+
- Replaced bash 4.0+ `${5,,}` lowercase expansion in `scripts/ci/run-install-step.sh` with `$(printf '%s' "$5" | tr '[:upper:]' '[:lower:]')` for compatibility with older bash versions.
12+
- Removed intermediate `TAIL_OUTPUT` variable in `scripts/ci/run-install-step.sh`; `tail` output is now piped directly to stdout, avoiding unnecessary memory consumption for large log files.
13+
14+
## 2026-04-10
15+
916
### 🔧 VHOST IMPORT CODE QUALITY IMPROVEMENTS
1017

1118
- Added explicit `return` statement at the end of `run_url_search_replace_if_present` in `scripts/functions/vhost/vhost-import.sh` to satisfy shell best-practice linting (SC2151/explicit-return warning).

scripts/ci/run-install-step.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COMPONENT_NAME="$1"
1111
TIMEOUT_SECONDS="$2"
1212
INSTALL_SCRIPT_PATH="$3"
1313
LOG_PATH="$4"
14-
EXPECTED_SCRIPT_SHA256="${5,,}"
14+
EXPECTED_SCRIPT_SHA256="$(printf '%s' "$5" | tr '[:upper:]' '[:lower:]')"
1515
INTEGER_REGEX='^[0-9]+$'
1616
SHA256_REGEX='^[a-f0-9]{64}$'
1717
LOG_TAIL_LINES=50
@@ -153,11 +153,8 @@ if [ "$SCRIPT_EXIT_CODE" -ne 0 ]; then
153153
fi
154154
echo "Script end time: $(date)" >> "$LOG_PATH"
155155
echo "Last ${LOG_TAIL_LINES} lines of output:"
156-
TAIL_OUTPUT="$(tail -n "$LOG_TAIL_LINES" "$LOG_PATH" 2>/dev/null)"
157-
TAIL_EXIT_CODE=$?
158-
if [ "$TAIL_EXIT_CODE" -eq 0 ]; then
159-
printf '%s\n' "$TAIL_OUTPUT"
160-
else
156+
if ! tail -n "$LOG_TAIL_LINES" "$LOG_PATH" 2>/dev/null; then
157+
TAIL_EXIT_CODE=$?
161158
echo "Failed to display log file contents: $LOG_PATH"
162159
echo "tail failed with exit code: $TAIL_EXIT_CODE"
163160
fi

0 commit comments

Comments
 (0)