Skip to content
Open
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 tests/e2e/template_instantiation_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ find "$TEST_REPO_PATH" -type f \
sed -i "s|$placeholder|$value|g" "$file"
fi
done
' _ "$file"
' _ {} \;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

The find -exec syntax is now syntactically correct, but the logic within the subshell is flawed. The filename passed by find via {} is available as $1 inside the subshell, but the script uses "$file". Since the sh -c block is single-quoted, it does not inherit the outer shell's $file variable. Unless you explicitly assign file="$1" at the start of the block, the sed command will operate on an empty string.

Try updating the sh -c block to: sh -c 'file="$1"; sed ...' _ {} \;

See Coverage in Codacy


log_pass "All placeholder tokens replaced"

Expand Down
Loading