1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Update _common.sh

This commit is contained in:
Rafi59 2017-06-17 12:20:09 +02:00 committed by GitHub
parent f46cad7a26
commit 9c1d829cb9

View file

@ -19,6 +19,19 @@ SHAARLI_SOURCE_SHA256="dbf0fd3fbe679ebd642ddef5f5a90244e07beda28d1aedd35ef04f9c7
# Source app helpers
. /usr/share/yunohost/helpers
# Add path
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
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
fi
echo $path_url
}
# Download and extract Shaarli sources to the given directory
# usage: extract_shaarli DESTDIR [AS_USER]
extract_shaarli() {