From 0ff839cae135743eff70c710795fb85f63fddb56 Mon Sep 17 00:00:00 2001 From: frju365 Date: Sat, 11 Feb 2017 21:20:59 +0100 Subject: [PATCH] Update install --- scripts/install | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/scripts/install b/scripts/install index 3519500..0203112 100644 --- a/scripts/install +++ b/scripts/install @@ -1,6 +1,7 @@ #!/bin/bash source ./_common +source ./.fonctions set -eu # Retrieve arguments @@ -17,29 +18,6 @@ source /usr/share/yunohost/helpers sudo yunohost app checkurl "${domain}${path}" -a "$app" \ || ynh_die "Path not available: ${domain}${path}" -# Normalize the url path syntax -# Handle the slash at the beginning of path and its absence at ending -# Return a normalized url path -# -# example: url_path=$(ynh_normalize_url_path $url_path) -# ynh_normalize_url_path example -> /example -# ynh_normalize_url_path /example -> /example -# ynh_normalize_url_path /example/ -> /example -# -# 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=$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:${#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 -} - ynh_normalize_url_path $path # Install dependency to convert tracks to a readable format for the browser