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:
parent
a17bdd4840
commit
6555ee359c
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
Loading…
Reference in a new issue