Fix local command bug.

This commit is contained in:
Daniel Perez 2016-05-14 11:11:16 +09:00
parent dbbb0a5b7c
commit 61e014a2d6
2 changed files with 14 additions and 0 deletions

View File

@ -66,6 +66,10 @@ version_command() {
local version=$3
if [ $cmd = "local" ]; then
file=$(pwd)/.tool-versions
fi
check_if_version_exists $plugin $version
if [ -f $file ] && grep $plugin $file > /dev/null; then

View File

@ -67,6 +67,16 @@ teardown() {
run local_command bar
[ "$status" -eq 0 ]
[ "$output" = "1.0.0" ]
rm .tool-versions
run local_command foo 1.2.0
[ -f .tool-versions ]
run local_command foo
[ "$status" -eq 0 ]
[ "$output" = "1.2.0" ]
run global_command foo
[ "$output" = "1.0.0" ]
}
@test "local should fallback to legacy-file when enabled" {