Commit c327ada
fix(scripts): codegen via
Copilot was right that command substitution is the wrong shape here. A `$(…)`
arg list silently swallows a producer failure (the script could exit non-zero
and lex would still run on partial/empty input and "succeed"). Switch to the
pipe + xargs form the original gen-* used:
node ./scripts/codegen-lexicon-files.js | xargs -0 -r lex gen-…
- `set -o pipefail` makes a producer failure abort the pipeline (verified: a
plain pipe reports exit 0 on producer failure; pipefail reports 1). dash —
the sh on Ubuntu CI and here — supports it.
- `-r` skips lex on empty input; `-0` (NUL-delimited from the script) is robust
to any path chars; xargs also sidesteps ARG_MAX.
- The script now exits non-zero + writes nothing if it finds no lexicons, so an
internal bug surfaces rather than codegenning nothing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>node … | xargs -0 -r under pipefail, not $(…)1 parent 7cb3ce4 commit c327ada
2 files changed
Lines changed: 19 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
0 commit comments