mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #567 from genezys/patch-1
Remove carriage return characters in version file Fixes #566
This commit is contained in:
commit
f71e22768c
2 changed files with 7 additions and 0 deletions
|
@ -8,6 +8,7 @@ VERSION_FILE="$1"
|
|||
if [ -e "$VERSION_FILE" ]; then
|
||||
# Read the first non-whitespace word from the specified version file.
|
||||
# Be careful not to load it whole in case there's something crazy in it.
|
||||
IFS="${IFS}"$'\r'
|
||||
words=( $(cut -b 1-1024 "$VERSION_FILE") )
|
||||
version="${words[0]}"
|
||||
|
||||
|
|
|
@ -64,3 +64,9 @@ IN
|
|||
run rbenv-version-file-read my-version
|
||||
assert_success "1.8.7"
|
||||
}
|
||||
|
||||
@test "ignores carriage returns" {
|
||||
cat > my-version <<< $'1.9.3\r'
|
||||
run rbenv-version-file-read my-version
|
||||
assert_success "1.9.3"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue