functional2: handle unset or empty BUILD_TEST_SHELL properly
If BUILD_TEST_SHELL is not set or empty, None or the empty string respectively should not make it into the PATH. Ensure this property. Change-Id: I4ce9b0c06c407b465308b63b9cb64e7d6a6a6964
This commit is contained in:
@@ -20,12 +20,13 @@ class _ManagedPath:
|
||||
Wrapper class to handle building the `PATH` environment variable
|
||||
"""
|
||||
|
||||
build_shell: dataclasses.InitVar[str]
|
||||
build_shell: dataclasses.InitVar[str | None]
|
||||
"""statically linked shell to use within builds which provides coreutils functionality"""
|
||||
_path: list[str] = dataclasses.field(default_factory=list)
|
||||
|
||||
def __post_init__(self, build_shell: str):
|
||||
self.prepend(build_shell)
|
||||
def __post_init__(self, build_shell: str | None):
|
||||
if build_shell:
|
||||
self.prepend(build_shell)
|
||||
|
||||
def to_path(self) -> str:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user