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.

🟡 MEDIUM RISK

The find syntax is now valid, but the replacement logic remains a no-op because variables like $placeholder and $value are inside single quotes, which prevents the parent shell from expanding them. Additionally, using \; executes the shell script once per file; using + is more efficient for processing multiple files.

Refactor the find command to pass variables as positional arguments to the subshell. For example:

find ... -exec sh -c 'p="$1"; v="$2"; shift 2; for file in "$@"; do sed -i "s/$p/$v/g" "$file"; done' _ "$placeholder" "$value" {} +


log_pass "All placeholder tokens replaced"

Expand Down
Loading