Skip to content

Commit f1d1c4e

Browse files
committed
fix: resolve shellcheck warnings and improve script efficiency
1 parent bda26e1 commit f1d1c4e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/sh/sync-agents.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,21 +370,23 @@ add_default_gitignore_entries() {
370370
local tmp
371371
tmp="$(mktemp)"
372372
local in_section=false
373+
# shellcheck disable=SC2034
373374
local section_found=false
374375

375376
while IFS= read -r line; do
376377
if [[ "$line" == "$marker" ]]; then
377378
in_section=true
378379
section_found=true
379380
# Output the marker
380-
echo "$line" >> "$tmp"
381-
# Output all default entries
382-
echo ".cursor/*" >> "$tmp"
383-
echo "!.cursor/rules" >> "$tmp"
384-
echo ".codex/*" >> "$tmp"
385-
echo "!.codex/instructions.md" >> "$tmp"
386-
echo ".github/copilot/*" >> "$tmp"
387-
echo "!.github/copilot/instructions.md" >> "$tmp"
381+
{
382+
echo "$line"
383+
echo ".cursor/*"
384+
echo "!.cursor/rules"
385+
echo ".codex/*"
386+
echo "!.codex/instructions.md"
387+
echo ".github/copilot/*"
388+
echo "!.github/copilot/instructions.md"
389+
} >> "$tmp"
388390
continue
389391
fi
390392

0 commit comments

Comments
 (0)