Commit c1a3497
committed
Resolve local feature paths relative to the config file's directory
Local-path features are spec'd as relative to the containing
devcontainer.json (see `featureFolderPath` computed above), but the
parent-escape sanity check was anchored at `${workspaceRoot}/.devcontainer`.
When `--config` points to a devcontainer.json that lives outside that
folder (e.g. an out-of-tree config supplied by an editor integration),
every local feature is rejected even though its resolved path is a
sibling of the config.
Anchor the check at `path.dirname(configPath)` so it mirrors how the
path is actually resolved. Existing escape coverage still holds
(e.g. './../featureC' relative to /workspace/.devcontainer.json
resolves to /workspace/featureC -> relative '../featureC' -> rejected).
Add a regression test exercising an external config directory.1 parent 65f98a5 commit c1a3497
2 files changed
Lines changed: 32 additions & 3 deletions
File tree
- src
- spec-configuration
- test/container-features
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
846 | | - | |
847 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
848 | 853 | | |
849 | 854 | | |
850 | 855 | | |
851 | 856 | | |
852 | | - | |
| 857 | + | |
853 | 858 | | |
854 | 859 | | |
855 | 860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
191 | 215 | | |
192 | 216 | | |
193 | 217 | | |
| |||
0 commit comments