1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dont-code_ynh.git synced 2024-09-03 18:26:34 +02:00

Merge pull request #35 from YunoHost-Apps/dev

Fixed doc dir issue when upgrading
This commit is contained in:
Gérard Collin 2024-02-15 16:59:03 +01:00 committed by GitHub
commit 96fa065201
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 3 deletions

View file

@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Shipped version:** 0.2.10~ynh5
**Shipped version:** 0.2.10~ynh6
**Demo:** https://dont-code.net/apps.html

View file

@ -32,7 +32,7 @@ This Yunohost app installs the server part (services + mongo database) needed to
- As well any documents or images uploaded by users will be backed up
**Version incluse :** 0.2.10~ynh5
**Version incluse :** 0.2.10~ynh6
**Démo :** https://dont-code.net/apps.html

View file

@ -7,7 +7,7 @@ name = "Dont-code Services"
description.en = "Install services and databases needed to support Dont-code platform"
description.fr = "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code"
version = "0.2.10~ynh5"
version = "0.2.10~ynh6"
maintainers = ["Dont-code Team"]

View file

@ -42,6 +42,13 @@ if [[ -n "${document_path:-}" ]]; then
fi
if [[ -n "${html_path:-}" ]]; then
# document dir has moved from html_path to data_dir, so set the variable accordingly
if [[ ${document_dir} == ${html_path}* ]]; then
document_dir=$data_dir/docs
ynh_app_setting_set --app="$app" --key=document_dir --value="$document_dir"
fi
# Migrate html_path to data_dir
mv "$html_path/index.html" "$html_path/docs" "$data_dir"
old_doc_dir="$html_path/docs"
@ -56,6 +63,7 @@ if [[ -n "${html_path:-}" ]]; then
ynh_backup_if_checksum_is_different --file="$install_dir/.env"
ynh_replace_string --match_string="$old_doc_dir" --replace_string="$document_dir" --target_file="$install_dir/.env"
ynh_store_file_checksum --file="$install_dir/.env"
fi
# Regenerate the .env file if the document_url was incorrectly set before

View file

@ -10,3 +10,5 @@ test_format = 1.0
# -------------------------------
test_upgrade_from.7852cc4bf44ff20ee51fe35f3f53dc105e0f6d79.name= "2023-01-07 - Added Ssh support for dev."
test_upgrade_from.e89eebdac9f59202202d07972e274ebe6fc7c51c.name= "Before Manifest v2."