Commit 31d2e67
committed
refactor(scripts): array-expand COMPOSE_FLAGS for SC2086 + glob safety
validate.sh, dream-preflight.sh, and validate-compose-stack.sh
expanded $COMPOSE_FLAGS (and $ENV_FILE_FLAG) unquoted when invoking
docker compose. Convert to bash-array expansion via `read -ra flags
<<< "$COMPOSE_FLAGS"` followed by `"${flags[@]}"`, matching the
established pattern in dream-cli.
Benefits:
- Eliminates 4 SC2086 shellcheck warnings.
- Prevents accidental glob expansion of flag values.
- Aligns three more consumer scripts with the project-canonical
compose-flags consumption pattern.
Note: resolve-compose-stack.sh emits relative paths only, so
absolute install paths with spaces (the "Jane Smith" scenario
sometimes raised on reports) do not appear in COMPOSE_FLAGS by
design. This refactor does not fix that scenario — it is
shellcheck/glob hardening and convention alignment.
Two sites in validate.sh (L64/65) previously passed a compose
invocation as a string to a check() helper running `bash -c "$cmd"`;
those are inlined as direct if/grep pipelines so array expansion
applies correctly without refactoring check() itself. Other check()
callers are untouched.1 parent d5154c3 commit 31d2e67
3 files changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
56 | | - | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
70 | | - | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
65 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
66 | 84 | | |
67 | 85 | | |
68 | 86 | | |
| |||
118 | 136 | | |
119 | 137 | | |
120 | 138 | | |
121 | | - | |
| 139 | + | |
122 | 140 | | |
123 | 141 | | |
124 | 142 | | |
| |||
0 commit comments