1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/fluffychat_ynh.git synced 2024-09-03 18:36:04 +02:00

remove potential trailing slash to avoid double slashes

This commit is contained in:
OniriCorpe 2024-01-25 23:16:00 +01:00
parent 2f5731ab9e
commit 366c45ffb5
3 changed files with 9 additions and 3 deletions

View file

@ -20,7 +20,9 @@ ynh_change_url_nginx_config
# SPECIFIC MODIFICATIONS # SPECIFIC MODIFICATIONS
#================================================= #=================================================
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path/\">" --target_file="$install_dir/index.html" # remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -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 # Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path/\">" --target_file="$install_dir/index.html" # remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
chown -R "www-data:www-data" "$install_dir" chown -R "www-data:www-data" "$install_dir"

View file

@ -24,7 +24,9 @@ then
# Download, check integrity, uncompress and patch the source from manifest.toml # Download, check integrity, uncompress and patch the source from manifest.toml
ynh_setup_source --dest_dir="$install_dir" ynh_setup_source --dest_dir="$install_dir"
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path/\">" --target_file="$install_dir/index.html" # remove potential trailing slash to avoid double slashes
path_without_trailing_slash=${path%/}
ynh_replace_string --match_string="<base href=".*">" --replace_string="<base href=\"$path_without_trailing_slash/\">" --target_file="$install_dir/index.html"
fi fi
chown -R "www-data:www-data" "$install_dir" chown -R "www-data:www-data" "$install_dir"