mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Fix loop bug during install with blank line in .tool-versions
This commit is contained in:
parent
c312b77137
commit
d217514081
@ -14,19 +14,14 @@ install_local_tool_versions() {
|
||||
if [ -f $(pwd)/.tool-versions ]; then
|
||||
local asdf_versions_path=$(pwd)/.tool-versions
|
||||
|
||||
local read_done=false
|
||||
until $read_done; do
|
||||
read tool_line || read_done=true
|
||||
|
||||
if $read_done ; then
|
||||
break;
|
||||
fi
|
||||
|
||||
while read tool_line; do
|
||||
IFS=' ' read -a tool_info <<< $tool_line
|
||||
local t_name=$(echo "${tool_info[0]}" | xargs)
|
||||
local t_version=$(echo "${tool_info[1]}" | xargs)
|
||||
local tool_name=$(echo "${tool_info[0]}" | xargs)
|
||||
local tool_version=$(echo "${tool_info[1]}" | xargs)
|
||||
|
||||
install_command $t_name $t_version
|
||||
if ! [[ -z "$tool_name" || -z "$tool_version" ]]; then
|
||||
install_tool_version $tool_name $tool_version
|
||||
fi
|
||||
done < $asdf_versions_path
|
||||
else
|
||||
echo "Either specify a tool & version in the command"
|
||||
|
Loading…
Reference in New Issue
Block a user