mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Add warning to when using deprecated plugins
This can be removed after we've given users enough time to update.
This commit is contained in:
parent
4d75ddd50b
commit
511535b750
@ -6,6 +6,8 @@ current_command() {
|
||||
local version=$(parse_version_file $version_file_path $plugin_name)
|
||||
check_if_version_exists $plugin_name $version
|
||||
|
||||
check_for_deprecated_plugin $plugin_name
|
||||
|
||||
if [ -z "$version" ]; then
|
||||
echo "No version set for $plugin_name"
|
||||
exit 1
|
||||
@ -13,3 +15,20 @@ current_command() {
|
||||
echo "$version (set by $version_file_path)"
|
||||
fi
|
||||
}
|
||||
|
||||
# Warn if the plugin isn't using the updated legacy file api.
|
||||
check_for_deprecated_plugin() {
|
||||
local plugin_name=$1
|
||||
|
||||
local plugin_path=$(get_plugin_path "$plugin_name")
|
||||
local legacy_config=$(get_asdf_config_value "legacy_version_file")
|
||||
local deprecated_script="${plugin_path}/bin/get-version-from-legacy-file"
|
||||
local new_script="${plugin_path}/bin/list-legacy-filenames"
|
||||
|
||||
if [ "$legacy_config" = "yes" ] && [ -f $deprecated_script ] && [ ! -f $new_script ]; then
|
||||
echo "Heads up! It looks like your $plugin_name plugin is out of date. You can update it with:"
|
||||
echo ""
|
||||
echo " asdf plugin-update $plugin_name"
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user