mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Add a helpful error message to the install command to warn users when they don't specify a version to install.
This commit is contained in:
parent
127f926391
commit
7c28074423
@ -4,6 +4,9 @@ install_command() {
|
||||
|
||||
if [ "$plugin_name" = "" ] && [ "$full_version" = "" ]; then
|
||||
install_local_tool_versions
|
||||
elif [[ $# -eq 1 ]]; then
|
||||
display_error "You must specify a name and a version to install"
|
||||
exit 1
|
||||
else
|
||||
install_tool_version $plugin_name $full_version
|
||||
fi
|
||||
|
@ -64,3 +64,15 @@ teardown() {
|
||||
[ "$($ASDF_DIR/shims/dummy world hello)" == "This is Dummy 1.0! hello world" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "install_command fails when the name or version are not specified" {
|
||||
run install_command dummy
|
||||
[ "$status" -eq 1 ]
|
||||
[ "$output" = "You must specify a name and a version to install" ]
|
||||
[ ! -f $ASDF_DIR/installs/dummy/1.1/version ]
|
||||
|
||||
run install_command 1.1
|
||||
[ "$status" -eq 1 ]
|
||||
[ "$output" = "You must specify a name and a version to install" ]
|
||||
[ ! -f $ASDF_DIR/installs/dummy/1.1/version ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user