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

Small fix on ynh_url_join

This commit is contained in:
Kayou 2019-02-10 00:08:12 +01:00
parent a17bdd4840
commit 6555ee359c
No known key found for this signature in database
GPG key ID: 823A2CBE071D3126

View file

@ -41,6 +41,15 @@ ynh_local_curl () {
curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url" curl --silent --show-error -kL -H "Host: $domain" --resolve $domain:443:127.0.0.1 $POST_data "$full_page_url"
} }
# Join several urls together
# Return a concatenate normalized url path
#
# example: url_path=$(ynh_url_join $url_path /admin /index.php)
# ynh_url_join example admin index.php -> /example/admin/index.php
# ynh_url_join /example admin /index.php -> /example/admin/index.php
# ynh_url_join / -> /
#
# usage: ynh_url_join url1 url2 ...
ynh_url_join() { ynh_url_join() {
if [ "$#" -eq 0 ]; then if [ "$#" -eq 0 ]; then
ynh_die "Illegal number of parameters" ynh_die "Illegal number of parameters"
@ -60,6 +69,6 @@ ynh_url_join() {
full_url=${full_url}${var} full_url=${full_url}${var}
done done
full_url=$(ynh_normalize_url_path $full_url) full_url=$(ynh_normalize_url_path ${full_url:-'/'})
echo $full_url echo $full_url
} }