Skip to content

Commit

Permalink
Make the comma split work in zsh (#27347)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored and pull[bot] committed Feb 12, 2024
1 parent ade9f56 commit 9901409
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/setup/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ _install_additional_pip_requirements() {
done

if ! [ -z "$_SETUP_PLATFORM" ]; then
IFS="," read -r -a _PLATFORMS <<<"$_SETUP_PLATFORM"
if [ -n "$ZSH_VERSION" ]; then
IFS="," read -r -A _PLATFORMS <<<"$_SETUP_PLATFORM"
else
IFS="," read -r -a _PLATFORMS <<<"$_SETUP_PLATFORM"
fi
for platform in "${_PLATFORMS[@]}"; do
# Allow none as an alias of nothing extra installed (like -p none)
if [ "$platform" != "none" ]; then
Expand All @@ -43,7 +47,10 @@ _install_additional_pip_requirements() {
-c "$_CHIP_ROOT/scripts/setup/constraints.txt"
fi
done
unset _PLATFORMS
fi

unset _SETUP_PLATFORM
}

_bootstrap_or_activate() {
Expand Down

0 comments on commit 9901409

Please sign in to comment.