1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/snserver_ynh.git synced 2024-09-03 20:26:22 +02:00

Fix issues

This commit is contained in:
Fabian Wilkens 2021-02-07 23:05:13 +01:00
parent daeda28946
commit 9420d6cc20
No known key found for this signature in database
GPG key ID: 23DFA025BB4E9FAB
2 changed files with 7 additions and 6 deletions

View file

@ -30,6 +30,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
access_domain=$(ynh_app_setting_get --app=$app --key=access_domain) 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 # Add settings here as needed by your application
#db_name=$(ynh_app_setting_get --app=$app --key=db_name) #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 ] if [ $change_domain -eq 1 ]
then then
mail_new="$app@$domain_new" new_mail="$app@$new_domain"
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="$mail" --replace_string="$new_mail" --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" ynh_replace_string --match_string="$domain" --replace_string="$new_domain" --target_file="$final_path/live/app/views/user_mailer/welcome.html.erb"
fi fi
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
then 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 fi
#================================================= #=================================================

View file

@ -129,7 +129,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
# Backup files to keep # Backup files to keep
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
if [ -d "$final_path/live/.env" ] ; then if [ -f "$final_path/live/.env" ] ; then
cp -Rp "$final_path/live/.env" "$tmpdir" cp -Rp "$final_path/live/.env" "$tmpdir"
fi fi
if [ -d "$final_path/live/log" ] ; then if [ -d "$final_path/live/log" ] ; then
@ -140,7 +140,7 @@ then
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
mkdir -p "$final_path" mkdir -p "$final_path"
ynh_setup_source --dest_dir="$final_path/live" 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" cp -Rp "$tmpdir/.env" "$final_path/live"
fi fi
if [ -d "$tmpdir/log" ] ; then if [ -d "$tmpdir/log" ] ; then