Skip to content

Commit 1568468

Browse files
andy31415andreilitvinrestyled-commits
authored andcommitted
Make the comma split work in zsh (#27347)
* Make the comma split work in zsh * Update string substitution a bit * Remove extra conditional * Use zsh_version to determine how to read * Slight simplification * Cleanup variables as well * Restyled by shfmt --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 1722b0c commit 1568468

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/setup/bootstrap.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ _install_additional_pip_requirements() {
3333
done
3434

3535
if ! [ -z "$_SETUP_PLATFORM" ]; then
36-
IFS="," read -r -a _PLATFORMS <<<"$_SETUP_PLATFORM"
36+
if [ -n "$ZSH_VERSION" ]; then
37+
IFS="," read -r -A _PLATFORMS <<<"$_SETUP_PLATFORM"
38+
else
39+
IFS="," read -r -a _PLATFORMS <<<"$_SETUP_PLATFORM"
40+
fi
3741
for platform in "${_PLATFORMS[@]}"; do
3842
# Allow none as an alias of nothing extra installed (like -p none)
3943
if [ "$platform" != "none" ]; then
@@ -43,7 +47,10 @@ _install_additional_pip_requirements() {
4347
-c "$_CHIP_ROOT/scripts/setup/constraints.txt"
4448
fi
4549
done
50+
unset _PLATFORMS
4651
fi
52+
53+
unset _SETUP_PLATFORM
4754
}
4855

4956
_bootstrap_or_activate() {

0 commit comments

Comments
 (0)