Skip to content

Commit b247298

Browse files
mnriemCopilot
andcommitted
fix: address review feedback on bash 3.2 portability changes
- create-new-feature.sh: replace the non-portable `\b...\b` grep word-boundary (BSD grep treats `\b` as a backspace, so the acronym branch could silently fail) with `grep -qw`, matching its twin create-new-feature-branch.sh, and pipe the description via `printf '%s'` instead of `echo`. - create-new-feature-branch.sh: switch the acronym check to `printf '%s'` as well so both twins are identical and avoid `echo` on user-provided text. - update-agent-context.sh: reword the apostrophe-free self-seeding comment to be clearer and less easy to misread. Verified under bash 3.2.57 (full bash-script suite green) and shellcheck --severity=error. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous) Co-authored-by: Copilot <[email protected]>
1 parent fdaaa98 commit b247298

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

‎extensions/agent-context/scripts/bash/update-agent-context.sh‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,11 @@ if isinstance(raw_files, list):
120120
if not context_files:
121121
add_context_file(get_str(data, "context_file"))
122122
if not context_files:
123-
# Self-seed: the agent-context extension owns its lifecycle, so when its
124-
# own config declares no target it derives one from the active integration
125-
# recorded in init-options.json, using the OWN bundled mapping of the
126-
# agent-context extension
127-
# (agent-context-defaults.json). This is independent of the Specify CLI by
128-
# design — nothing here imports specify_cli.
123+
# Self-seed: the agent-context extension manages its own lifecycle, so when
124+
# its config declares no target, it derives one from the active integration
125+
# recorded in init-options.json, mapped through the bundled
126+
# agent-context-defaults.json file. This is independent of the Specify CLI
127+
# by design; nothing here imports specify_cli.
129128
project_root = sys.argv[3] if len(sys.argv) > 3 else "."
130129
integration_key = ""
131130
try:

‎extensions/git/scripts/bash/create-new-feature-branch.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ generate_branch_name() {
288288
if ! echo "$word" | grep -qiE "$stop_words"; then
289289
if [ ${#word} -ge 3 ]; then
290290
meaningful_words+=("$word")
291-
elif echo "$description" | grep -qw -- "$(printf '%s' "$word" | tr '[:lower:]' '[:upper:]')"; then
291+
elif printf '%s' "$description" | grep -qw -- "$(printf '%s' "$word" | tr '[:lower:]' '[:upper:]')"; then
292292
meaningful_words+=("$word")
293293
fi
294294
fi

‎scripts/bash/create-new-feature.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ generate_branch_name() {
152152
if ! echo "$word" | grep -qiE "$stop_words"; then
153153
if [ ${#word} -ge 3 ]; then
154154
meaningful_words+=("$word")
155-
elif echo "$description" | grep -q "\b$(printf '%s' "$word" | tr '[:lower:]' '[:upper:]')\b"; then
155+
elif printf '%s' "$description" | grep -qw -- "$(printf '%s' "$word" | tr '[:lower:]' '[:upper:]')"; then
156156
# Keep short words if they appear as uppercase in original (likely acronyms)
157157
meaningful_words+=("$word")
158158
fi

0 commit comments

Comments
 (0)