mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Suggest action when no version is set
This commit is contained in:
parent
4efa8a9707
commit
f15a0c9de3
@ -12,7 +12,7 @@ check_if_plugin_exists "$plugin_name"
|
||||
full_version=$(get_preset_version_for "$plugin_name")
|
||||
|
||||
if [ "$full_version" == "" ]; then
|
||||
echo "No version set for ${plugin_name}"
|
||||
echo "No version set for ${plugin_name}: please run `asdf <global|local> ${plugin_name} <version>`"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
@ -16,7 +16,7 @@ plugin_current_command() {
|
||||
check_for_deprecated_plugin "$plugin_name"
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
printf "%s\\n" "No version set for $plugin_name"
|
||||
printf "%s\\n" "No version set for $plugin_name: please run `asdf <global|local> ${plugin_name} <version>`"
|
||||
exit 1
|
||||
else
|
||||
printf "%-8s%s\\n" "$version" "(set by $version_file_path)"
|
||||
|
@ -14,7 +14,7 @@ current_version() {
|
||||
check_for_deprecated_plugin "$plugin_name"
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "No version set for $plugin_name"
|
||||
echo "No version set for $plugin_name: please run `asdf <global|local> ${plugin_name} <version>`"
|
||||
exit 1
|
||||
else
|
||||
echo "$version"
|
||||
|
@ -75,7 +75,7 @@ teardown() {
|
||||
echo 'foobar 1.0.0' >> $PROJECT_DIR/.tool-versions
|
||||
|
||||
run current_command
|
||||
expected="baz No version set for baz
|
||||
expected="baz No version set for baz: please run `asdf <global|local> baz <version>`
|
||||
dummy 1.1.0 (set by $PROJECT_DIR/.tool-versions)
|
||||
foobar 1.0.0 (set by $PROJECT_DIR/.tool-versions)"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user