mirror of
https://github.com/YunoHost-Apps/gogs_ynh.git
synced 2024-09-03 20:36:23 +02:00
Merge d09612f8de
into aa075b2051
This commit is contained in:
commit
1433cff9cd
2 changed files with 22 additions and 0 deletions
|
@ -33,6 +33,9 @@ GOGS_BINARY_URL="https://github.com/gogits/gogs/releases/download/v${VERSION}/${
|
||||||
extract_gogs() {
|
extract_gogs() {
|
||||||
local DESTDIR=$1
|
local DESTDIR=$1
|
||||||
local TMPDIR=$(mktemp -d)
|
local TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# retrieve and extract Gogs tarball
|
# retrieve and extract Gogs tarball
|
||||||
gogs_tarball="/tmp/gogs.zip"
|
gogs_tarball="/tmp/gogs.zip"
|
||||||
|
@ -44,3 +47,16 @@ extract_gogs() {
|
||||||
sudo rsync -a "$TMPDIR"/gogs/* "$DESTDIR"
|
sudo rsync -a "$TMPDIR"/gogs/* "$DESTDIR"
|
||||||
rm -rf "$gogs_tarball" "${TMPDIR:-/tmp/fakefile}"
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -19,6 +19,12 @@ dbuser=$app
|
||||||
# Source app helpers
|
# Source app helpers
|
||||||
source /usr/share/yunohost/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
|
# TODO: Check domain/path availability with app helper
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
||||||
|| ynh_die "The path ${domain}${path} is not available for app installation."
|
|| ynh_die "The path ${domain}${path} is not available for app installation."
|
||||||
|
|
Loading…
Add table
Reference in a new issue