From 9420d6cc2036932b15e45a69761831c7c1eecde3 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 7 Feb 2021 23:05:13 +0100 Subject: [PATCH] Fix issues --- scripts/change_url | 9 +++++---- scripts/upgrade | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 2f82b92..f8056d5 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -30,6 +30,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) access_domain=$(ynh_app_setting_get --app=$app --key=access_domain) +mail=$(ynh_app_setting_get --app=$app --key=mail) # Add settings here as needed by your application #db_name=$(ynh_app_setting_get --app=$app --key=db_name) @@ -120,13 +121,13 @@ ynh_replace_string --match_string="RAILS_RELATIVE_URL_ROOT=$old_path" --replace_ if [ $change_domain -eq 1 ] then - mail_new="$app@$domain_new" - ynh_replace_string --match_string="$mail" --replace_string="$mail_new" --target_file="$final_path/live/app/mailers/application_mailer.rb" - ynh_replace_string --match_string="$domain" --replace_string="$domain_new" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb" + new_mail="$app@$new_domain" + ynh_replace_string --match_string="$mail" --replace_string="$new_mail" --target_file="$final_path/live/app/mailers/application_mailer.rb" + ynh_replace_string --match_string="$domain" --replace_string="$new_domain" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb" fi if [ $change_path -eq 1 ] then - ynh_replace_string --match_string="$path_url" --replace_string="$path_new" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb" + ynh_replace_string --match_string="$path_url" --replace_string="$new_path" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index ee441dd..c493af3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,7 +129,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then # Backup files to keep tmpdir=$(mktemp -d) - if [ -d "$final_path/live/.env" ] ; then + if [ -f "$final_path/live/.env" ] ; then cp -Rp "$final_path/live/.env" "$tmpdir" fi if [ -d "$final_path/live/log" ] ; then @@ -140,7 +140,7 @@ then # Download, check integrity, uncompress and patch the source from app.src mkdir -p "$final_path" ynh_setup_source --dest_dir="$final_path/live" - if [ -d "$tmpdir/.env" ] ; then + if [ -f "$tmpdir/.env" ] ; then cp -Rp "$tmpdir/.env" "$final_path/live" fi if [ -d "$tmpdir/log" ] ; then