mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Merge pull request #371 from phunehehe/version-set-by
commands/current: add space before parenthesis
This commit is contained in:
commit
f708e3c15f
@ -19,7 +19,7 @@ plugin_current_command() {
|
|||||||
printf "%s\\n" "$(display_no_version_set "$plugin_name")"
|
printf "%s\\n" "$(display_no_version_set "$plugin_name")"
|
||||||
exit 126
|
exit 126
|
||||||
else
|
else
|
||||||
printf "%-8s%s\\n" "$version" "(set by $version_file_path)"
|
printf "%-8s (set by %s)\\n" "$version" "$version_file_path"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ setup() {
|
|||||||
install_dummy_plugin
|
install_dummy_plugin
|
||||||
install_dummy_version "1.1.0"
|
install_dummy_version "1.1.0"
|
||||||
install_dummy_version "1.2.0"
|
install_dummy_version "1.2.0"
|
||||||
|
install_dummy_version "nightly-2000-01-01"
|
||||||
|
|
||||||
PROJECT_DIR=$HOME/project
|
PROJECT_DIR=$HOME/project
|
||||||
mkdir $PROJECT_DIR
|
mkdir $PROJECT_DIR
|
||||||
@ -25,7 +26,16 @@ teardown() {
|
|||||||
|
|
||||||
run current_command "dummy"
|
run current_command "dummy"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "$output" = "1.1.0 (set by $PROJECT_DIR/.tool-versions)" ]
|
[ "$output" = "1.1.0 (set by $PROJECT_DIR/.tool-versions)" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "current should handle long version name" {
|
||||||
|
cd $PROJECT_DIR
|
||||||
|
echo "dummy nightly-2000-01-01" >> $PROJECT_DIR/.tool-versions
|
||||||
|
|
||||||
|
run current_command "dummy"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ "$output" = "nightly-2000-01-01 (set by $PROJECT_DIR/.tool-versions)" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "current should derive from the legacy file if enabled" {
|
@test "current should derive from the legacy file if enabled" {
|
||||||
@ -35,7 +45,7 @@ teardown() {
|
|||||||
|
|
||||||
run current_command "dummy"
|
run current_command "dummy"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "$output" = "1.2.0 (set by $PROJECT_DIR/.dummy-version)" ]
|
[ "$output" = "1.2.0 (set by $PROJECT_DIR/.dummy-version)" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "current should error when the plugin doesn't exist" {
|
@test "current should error when the plugin doesn't exist" {
|
||||||
@ -76,8 +86,8 @@ teardown() {
|
|||||||
|
|
||||||
run current_command
|
run current_command
|
||||||
expected="baz No version set for baz; please run \`asdf <global | local> baz <version>\`
|
expected="baz No version set for baz; please run \`asdf <global | local> baz <version>\`
|
||||||
dummy 1.1.0 (set by $PROJECT_DIR/.tool-versions)
|
dummy 1.1.0 (set by $PROJECT_DIR/.tool-versions)
|
||||||
foobar 1.0.0 (set by $PROJECT_DIR/.tool-versions)"
|
foobar 1.0.0 (set by $PROJECT_DIR/.tool-versions)"
|
||||||
|
|
||||||
[ "$expected" = "$output" ]
|
[ "$expected" = "$output" ]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user