From b833392ded61be0ad5f6712f9e44451a1da82c44 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Wed, 21 Jun 2017 18:46:57 +0200 Subject: [PATCH 1/2] Update malformed path error in CI --- scripts/_common.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8d8cf4c..1fc4504 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -33,6 +33,9 @@ GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/${ extract_gogs() { local DESTDIR=$1 local TMPDIR=$(mktemp -d) + + +} # retrieve and extract Gogs tarball gogs_tarball="/tmp/gogs.zip" @@ -44,3 +47,16 @@ extract_gogs() { sudo rsync -a "$TMPDIR"/gogs/* "$DESTDIR" rm -rf "$gogs_tarball" "${TMPDIR:-/tmp/fakefile}" } + +# 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 +} From d09612f8de659a71d7de9638fff55ff616ad0cb9 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Wed, 21 Jun 2017 18:50:52 +0200 Subject: [PATCH 2/2] Update malformed path CI error --- scripts/install | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index c8102cd..935227c 100644 --- a/scripts/install +++ b/scripts/install @@ -19,6 +19,12 @@ dbuser=$app # Source app helpers source /usr/share/yunohost/helpers +#================================================= +# CHECK IF THE APP CAN BE INSTALLED WITH THIS ARGS +#================================================= + +path=$(ynh_normalize_url_path $path) # Vérifie et corrige la syntaxe du path. + # TODO: Check domain/path availability with app helper sudo yunohost app checkurl "${domain}${path}" -a "$app" \ || ynh_die "The path ${domain}${path} is not available for app installation."