Skip to content

Commit 8528cf9

Browse files
committed
Restrict replace %7
1 parent f737936 commit 8528cf9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sync.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@ for target in "${targets[@]}"; do
7979
echo " Empty dir -> full sync"
8080
rsync "${RSYNC_OPTS[@]}" "$script_dir/." "$target/"
8181

82-
# Replace every occurrence of the literal word "template" in each text file
82+
# Replace every occurrence of the literal word "template" in package.json and README.md
8383
base="$(basename "$target")"
84-
find "$target" -type f -exec grep -Il . {} + |
85-
while IFS= read -r file; do
86-
sed -i "s/template/${base}/g" "$file"
87-
done
84+
for file in "$target/package.json" "$target/README.md"; do
85+
[[ -f $file ]] && sed -i "s/\btemplate\b/${base}/g" "$file"
86+
done
8887

8988
else
9089
# Selective sync: exclude key project files and directories.

0 commit comments

Comments
 (0)