mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Merge pull request #403 from burnettk/support-tool-versions-without-newline
support .tool-versions content even if it does not end in a newline
This commit is contained in:
commit
22b709f94e
@ -40,7 +40,7 @@ install_local_tool_versions() {
|
||||
local asdf_versions_path
|
||||
asdf_versions_path=$(find_tool_versions)
|
||||
if [ -f "${asdf_versions_path}" ]; then
|
||||
while read -r tool_line; do
|
||||
while IFS= read -r tool_line || [ -n "$tool_line" ]; do
|
||||
IFS=' ' read -r -a tool_info <<< "$tool_line"
|
||||
local tool_name
|
||||
tool_name=$(echo "${tool_info[0]}" | xargs)
|
||||
|
@ -23,6 +23,14 @@ teardown() {
|
||||
[ $(cat $ASDF_DIR/installs/dummy/1.1/version) = "1.1" ]
|
||||
}
|
||||
|
||||
@test "install_command installs even if the user is terrible and does not use newlines" {
|
||||
cd $PROJECT_DIR
|
||||
echo -n 'dummy 1.2' > ".tool-versions"
|
||||
run install_command
|
||||
[ "$status" -eq 0 ]
|
||||
[ $(cat $ASDF_DIR/installs/dummy/1.2/version) = "1.2" ]
|
||||
}
|
||||
|
||||
@test "install_command set ASDF_CONCURRENCY" {
|
||||
run install_command dummy 1.0
|
||||
[ "$status" -eq 0 ]
|
||||
|
Loading…
Reference in New Issue
Block a user