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: 1 addition & 1 deletion bids_convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ fixup_run_numbers() {
else
local run_tag
run_tag="run-$(printf '%02d' "$run_num")"
local new_pattern="${pattern%_${suffix}}_${run_tag}_${suffix}"
local new_pattern="${pattern%_"${suffix}"}_${run_tag}_${suffix}"

for ext in .nii.gz .json .bval .bvec; do
local old="${search_dir}/${pattern}${ext}"
Expand Down
10 changes: 7 additions & 3 deletions tests/test_bids_convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ test_dry_run_creates_no_files() {
# then reports the pipeline as failed even though grep did match.
local out
out="$(bash "$SCRIPT" -i "$input_dir" -o "$output_dir" -n 2>&1)" || true
echo "$out" | grep -q "DRY-RUN" && \
echo " ✅ PASS: dry-run mode activated" && { ((PASS++)) || true; } || \
{ echo " ❌ FAIL: dry-run mode not detected"; ((FAIL++)) || true; }
if echo "$out" | grep -q "DRY-RUN"; then
echo " ✅ PASS: dry-run mode activated"
((PASS++)) || true
else
echo " ❌ FAIL: dry-run mode not detected"
((FAIL++)) || true
fi

teardown_tmp
}
Expand Down
Loading