Commit e5ae5ea
Just: reject a separator value that would run, instead of warning about it
`JUST_CMD_RULE` is interpolated whole into a shell script, so a value that is
not a shell comment gets executed -- with a zero exit status, no diagnostic,
and once for every place the separator appears. The comment above it said so,
and saying so was all that happened, which leaves the obligation with whoever
presets the variable to have first read the file explaining why they mustn't.
A rule is a single line by construction, so demanding one line starting with
`#` rejects exactly the values that would run, without having to describe what
running looks like. Reading the value once instead of twice is what makes that
expressible at all.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 29c7a53 commit e5ae5ea
2 files changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | 169 | | |
168 | 170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
43 | | - | |
| 47 | + | |
44 | 48 | | |
45 | 49 | | |
46 | 50 | | |
| |||
0 commit comments