From 867c83b3f8e768cf110b8d9f1426a2751a88339a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 24 Feb 2021 07:47:09 +0100 Subject: [PATCH] Fix rbenv alias not existing in previous version --- scripts/ynh_install_ruby__2 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/ynh_install_ruby__2 b/scripts/ynh_install_ruby__2 index e885b96..1d9bf8d 100644 --- a/scripts/ynh_install_ruby__2 +++ b/scripts/ynh_install_ruby__2 @@ -118,7 +118,10 @@ ynh_install_ruby () { # Remove previous version if grep --quiet "$YNH_APP_INSTANCE_NAME:" "$rbenv_install_dir/ynh_app_version" then - rbenv alias $YNH_APP_INSTANCE_NAME --remove + if grep --quiet "$YNH_APP_INSTANCE_NAME" $(rbenv alias --list) + then + rbenv alias $YNH_APP_INSTANCE_NAME --remove + fi sed --in-place "/$YNH_APP_INSTANCE_NAME:/d" "$rbenv_install_dir/ynh_app_version" fi