Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ and versions are tracked in the repo-root `VERSION` file.
shell `sleep` aliases or functions cannot shadow retry delays.
- Made `arg_parse` publish output arrays only after a parse succeeds, leaving
caller-owned outputs unchanged on late parse failures.
- Kept the warning-level ShellCheck profile clean for file section marker-count
validation.
- Reused shared marker validation inside `update_file_section`.

## [1.2.0] - 2026-07-04
Expand Down
8 changes: 4 additions & 4 deletions lib/bash/file/lib_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ file_section_exists() {
fi

local target_file="$1" beginning_marker="$2" end_marker="$3"
local beginning_marker_count end_marker_count
local beginning_marker_count _end_marker_count

[[ -f "$target_file" ]] || return 1
__file_section_marker_counts__ "$target_file" "$beginning_marker" "$end_marker" \
beginning_marker_count end_marker_count || return $?
beginning_marker_count _end_marker_count || return $?

((beginning_marker_count > 0))
}
Expand All @@ -152,13 +152,13 @@ file_section_needs_update() {
fi

local target_file="$1" beginning_marker="$2" end_marker="$3"
local beginning_marker_count end_marker_count
local beginning_marker_count _end_marker_count
local current_content_file="" new_content_file="" status=0
shift 3

[[ -f "$target_file" ]] || return 0
__file_section_marker_counts__ "$target_file" "$beginning_marker" "$end_marker" \
beginning_marker_count end_marker_count || return $?
beginning_marker_count _end_marker_count || return $?
((beginning_marker_count > 0)) || return 0

if ! std_make_temp_file new_content_file base-file-section-new; then
Expand Down
Loading