From f761671f994d558223c762d1853449c39126110d Mon Sep 17 00:00:00 2001 From: frju365 Date: Sat, 4 Mar 2017 00:06:03 +0100 Subject: [PATCH] Update .fonctions --- scripts/.fonctions | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/.fonctions b/scripts/.fonctions index f094d51..eebc7be 100644 --- a/scripts/.fonctions +++ b/scripts/.fonctions @@ -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