Commit 42ef4f3
committed
fix(tooling): parse devnet.env without eval, and stop dropping lines silently
The env loader was correct but unreadable: `eval "export $key=\$val"` escapes
the value so it expands after eval has parsed, and an `export name=value`
assignment suppresses word splitting, so multi-word values did arrive whole.
Nobody should have to know that to trust the line, and a reviewer already
read it as the interpolated form that would break SERVERS="host-a host-b".
Bash indirect expansion plus one quoted export word says the same thing with
nothing left to reparse.
While in there, the header's promise that comments and malformed lines are
skipped was only half true. A `# note` after an unquoted value landed inside
the value, so SERVERS picked up a host called '#' for sweep.sh to ssh to;
quoted values now delimit themselves, keeping a '#' that belongs to the value
(http://x/y#frag). A bare word with no '=' became a variable assigned its own
name. A leading-digit name reached `export` and produced its error instead of
ours. Indented lines were dropped outright. Names that can't be assigned are
now reported on stderr, because a config line that goes unread is how you
deploy against the wrong deployment.1 parent bce946e commit 42ef4f3
1 file changed
Lines changed: 33 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
14 | 20 | | |
15 | 21 | | |
16 | 22 | | |
| |||
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
41 | 65 | | |
42 | 66 | | |
43 | 67 | | |
0 commit comments