aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2021-02-24 07:47:09 +0100
committeryalh76 <yalh@yahoo.com>2021-02-24 07:47:09 +0100
commit867c83b3f8e768cf110b8d9f1426a2751a88339a (patch)
tree4c6c68a73659155f6998b5120476b257cc057f4f
parent9691d954dc29f8d3468b8de87d934d5954320871 (diff)
downloadmastodon_ynh-867c83b3f8e768cf110b8d9f1426a2751a88339a.tar.gz
mastodon_ynh-867c83b3f8e768cf110b8d9f1426a2751a88339a.tar.bz2
mastodon_ynh-867c83b3f8e768cf110b8d9f1426a2751a88339a.zip
Fix rbenv alias not existing in previous version
-rw-r--r--scripts/ynh_install_ruby__25
1 files changed, 4 insertions, 1 deletions
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