From 366c45ffb57ec47d3c80a5fb8a3b8a4d6fb10ee2 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Thu, 25 Jan 2024 23:16:00 +0100 Subject: [PATCH] remove potential trailing slash to avoid double slashes --- scripts/change_url | 4 +++- scripts/install | 4 +++- scripts/upgrade | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 51db2e9..26cd413 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -20,7 +20,9 @@ ynh_change_url_nginx_config # SPECIFIC MODIFICATIONS #================================================= -ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" +# remove potential trailing slash to avoid double slashes +path_without_trailing_slash=${path%/} +ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 77420f6..c969593 100755 --- a/scripts/install +++ b/scripts/install @@ -19,7 +19,9 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir" -ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" +# remove potential trailing slash to avoid double slashes +path_without_trailing_slash=${path%/} +ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" chown -R "www-data:www-data" "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index 4b674c7..d0606b0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,7 +24,9 @@ then # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir" - ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" + # remove potential trailing slash to avoid double slashes + path_without_trailing_slash=${path%/} + ynh_replace_string --match_string="" --replace_string="" --target_file="$install_dir/index.html" fi chown -R "www-data:www-data" "$install_dir"