devcontainers / devcontainers/cli

How to specify the default value with colon for localEnv.

Đang mở
#719 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
TypeScript
Star
3k
Fork
457
Merge trung bình
13 giờ 17 phút
Pull request đã merge (30 ngày)
6

Mô tả

Hi DevContainers Team,

The case for me is to set the index url for pip, so what I do is something like

```json
{
...
"remoteEnv": {
"PIP_INDEX_URL": "${localEnv:PIP_INDEX_URL:https://pypi.org/simple}"
}
}
```

I perfer a default value to handle the cases that `PIP_INDEX_URL` does not exist. But it turns out that when the env does not exist, the corresponding env in the vscode context will be set to `https` rather than `https://pypi.org/simple`. Any clues to make it happen?

Seems it is related to the code here:
https://github.com/devcontainers/cli/blob/f7d4c853bf8c284d784173f3e915a34d961b0b55/src/spec-common/variableSubstitution.ts#L85
If I understand correctly, one option could be setting the split limit to 1, and maybe another approach is that we can avoid set the env in the context if the value is empty.

Thanks in advance.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.