Skip to content

fix: avoid apostrophe in fm-brief.sh heredoc nested in command substitution - #1147

Closed
Seangee86 wants to merge 1 commit into
kunchenguid:mainfrom
Seangee86:fix/heredoc-apostrophe-bash32
Closed

fix: avoid apostrophe in fm-brief.sh heredoc nested in command substitution#1147
Seangee86 wants to merge 1 commit into
kunchenguid:mainfrom
Seangee86:fix/heredoc-apostrophe-bash32

Conversation

@Seangee86

Copy link
Copy Markdown

Summary

  • bin/fm-brief.sh crashes with unexpected EOF while looking for matching \'''on macOS's default bash (3.2.57) when scaffolding a ship brief for ano-mistakes`-mode project.
  • Root cause: macOS ships bash 3.2, which mis-parses a literal apostrophe inside a heredoc when that heredoc is nested inside a $(...) command substitution (reproduced independently outside this repo; a standalone top-level heredoc with the same apostrophe is fine, only the nested-in-$() case breaks).
  • The no-mistakes-mode DOD heredoc (DOD=$(cat <<EOF ... EOF)) in the ship-brief case block contains the word "firstmate's", which trips this.
  • Fix: reworded that one line to drop the apostrophe ("firstmate's authority check" -> "the firstmate authority check"). No behavior change, no other heredocs in the file are affected (verified none of the other apostrophes in the file sit inside a heredoc nested in $(...)).

Test plan

  • bash -n bin/fm-brief.sh passes (previously failed with the EOF/quote error)
  • bin/fm-brief.sh <id> <repo> (no-mistakes mode) scaffolds successfully end to end

…tution

macOS ships bash 3.2, which mis-parses a single quote inside a heredoc
when that heredoc is nested inside $(...). The no-mistakes DOD heredoc
in the ship-brief case block contained "firstmate's", which broke
fm-brief.sh with "unexpected EOF while looking for matching \'" on any
default macOS shell. Reworded to drop the apostrophe.
@kunchenguid

Copy link
Copy Markdown
Owner

thanks for tracking this down. i merged #1093, which fixes the same macOS bash 3.2 parse failure - it removes the command substitution around those heredocs instead of rewording the apostrophe, so i'm closing this one as superseded. appreciate the help here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants