mirror of
https://github.com/YunoHost-Apps/prestashop_ynh.git
synced 2024-09-03 20:06:39 +02:00
Update .fonctions
This commit is contained in:
parent
3df71ce5bb
commit
f761671f99
1 changed files with 7 additions and 7 deletions
|
@ -233,15 +233,15 @@ ynh_no_log() {
|
|||
# usage: ynh_normalize_url_path path_to_normalize
|
||||
# | arg: url_path_to_normalize - URL path to normalize before using it
|
||||
ynh_normalize_url_path () {
|
||||
path_url=$1
|
||||
test -n "$path_url" || ynh_die "ynh_normalize_url_path expect a URL path as first argument and received nothing."
|
||||
if [ "${path_url:0:1}" != "/" ]; then # If the first character is not a /
|
||||
path_url="/$path_url" # Add / at begin of path variable
|
||||
path=$1
|
||||
test -n "$path" || ynh_die "ynh_normalize_url_path expect a URL path as first argument and received nothing."
|
||||
if [ "${path:0:1}" != "/" ]; then # If the first character is not a /
|
||||
path="/$path" # Add / at begin of path variable
|
||||
fi
|
||||
if [ "${path_url:${#path_url}-1}" == "/" ] && [ ${#path_url} -gt 1 ]; then # If the last character is a / and that not the only character.
|
||||
path_url="${path_url:0:${#path_url}-1}" # Delete the last character
|
||||
if [ "${path:${#path}-1}" == "/" ] && [ ${#path} -gt 1 ]; then # If the last character is a / and that not the only character.
|
||||
path="${path:0:${#path}-1}" # Delete the last character
|
||||
fi
|
||||
echo $path_url
|
||||
echo $path
|
||||
}
|
||||
|
||||
# Create a database, an user and its password. Then store the password in the app's config
|
||||
|
|
Loading…
Add table
Reference in a new issue