2022-02-02 14:27:46 +00:00
#!/bin/bash
function update_footer {
export REPLACEWITH = '
2022-06-09 12:43:17 +00:00
2022-02-02 14:27:46 +00:00
---
2024-04-09 08:50:15 +00:00
[ We'\' ' re hiring!] ( https://woocommerce.com/careers/) Come work with us!
2022-02-02 14:27:46 +00:00
2024-10-10 16:37:27 +00:00
🐞 Found a mistake, or have a suggestion? [ Leave feedback about this document here.] ( https://github.com/woocommerce/woocommerce/issues/new?assignees= & labels = type%3A+documentation& template = suggestion-for-documentation-improvement-correction.md& title = Feedback%20on%20'$1' )
2022-06-09 12:43:17 +00:00
2022-02-02 14:27:46 +00:00
'
# Replace everything after <!-- FEEDBACK -->
if grep -q " $STARTTAG " " $1 " ; then
awk '/<!-- FEEDBACK -->/ {exit} {print}' $1 > tmp && mv tmp $1
fi
# Append feedback section.
printf '%s\n' " <!-- FEEDBACK --> $REPLACEWITH <!-- /FEEDBACK --> " '' >> $1
}
2022-11-10 08:52:04 +00:00
find ./docs -name "*.md" ! -path "./docs/examples*" ! -path "./docs/internal-developers*" | while read filename; do
2022-02-02 14:27:46 +00:00
update_footer $filename
done
find ./packages/checkout -name "*.md" | while read filename; do
update_footer $filename
done
find ./src/StoreApi -name "*.md" | while read filename; do
update_footer $filename
done