From 56ec85a82957836045c8bcaf78a56290c932037c Mon Sep 17 00:00:00 2001 From: tituspijean Date: Fri, 19 Mar 2021 00:00:09 +0100 Subject: [PATCH] Use ynh_add_config --- conf/configuration.yml | 6 +++--- scripts/install | 15 ++------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/conf/configuration.yml b/conf/configuration.yml index 6a2432f..44f1c2a 100644 --- a/conf/configuration.yml +++ b/conf/configuration.yml @@ -1,4 +1,4 @@ -baseUrl : "https://__DOMAIN__/__PATH__" +baseUrl : "https://__DOMAIN____PATH__" databaseConfiguration : host : "localhost" database : "__USER__" @@ -8,6 +8,6 @@ adminUser : username : "__ADMIN__" password : "__ADMIN_PWD__" password_confirmation : "__ADMIN_PWD__" - email : "__ADMIN_EML__" + email : "__ADMIN_MAIL__" settings : - forum_title : "__FORUM_TITLE__" + forum_title : "__TITLE__" diff --git a/scripts/install b/scripts/install index ff73c95..a22963d 100644 --- a/scripts/install +++ b/scripts/install @@ -148,19 +148,8 @@ ynh_exec_warn_less ynh_composer_exec --user=$app --phpversion=$phpversion --work #================================================= ynh_script_progression --message="Configuring Flarum..." --weight=2 -# Copy the configuration.yml to working directory -finalflarumconf="$final_path/configuration.yml" -cp ../conf/configuration.yml $finalflarumconf - -# Populate configuration.yml -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$finalflarumconf" -ynh_replace_string --match_string="/__PATH__" --replace_string="$path_url" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__DB_PWD__" --replace_string="$db_pwd" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__ADMIN_PWD__" --replace_string="$admin_pwd" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__ADMIN_EML__" --replace_string="$admin_mail" --target_file="$finalflarumconf" -ynh_replace_string --match_string="__FORUM_TITLE__" --replace_string="$title" --target_file="$finalflarumconf" +# Copy and populate configuration.yml to working directory +ynh_add_config --template="../conf/configuration.yml" --destination="$final_path/configuration.yml" # Execute post-installation pushd $final_path