1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00

Take review into account

This commit is contained in:
Jimmy Monin 2017-01-04 22:29:11 +01:00
parent 01f5b2ab23
commit 97502804a5
3 changed files with 8 additions and 15 deletions

View file

@ -16,11 +16,13 @@ APPLICATION_SOURCE_URL="https://kanboard.net/kanboard-${VERSION}.zip"
# usage: extract_application_to DESTDIR
extract_application() {
local DESTDIR=$1
archive="${DESTDIR}/application.zip"
TMPDIR=$(mktemp -d)
chmod 755 $TMPDIR
archive="${TMPDIR}/application.zip"
wget -q -O "$archive" "$APPLICATION_SOURCE_URL" \
|| ynh_die "Unable to download application archive"
# Here we process with unzip as would tar "--strip-component" option
unzip -qq "$archive" -d "$DESTDIR" && rm "$archive" && f=("$DESTDIR"/*) && mv "$DESTDIR"/*/* "$DESTDIR" && rm -f "${f[@]}"/.htaccess && rmdir "${f[@]}" \
unzip -qq "$archive" -d "$TMPDIR" \
|| ynh_die "Unable to extract application archive"
chmod 755 $DESTDIR
rm "$archive"
sudo rsync -a "$TMPDIR"/*/* "$DESTDIR"
}

View file

@ -45,12 +45,7 @@ ynh_app_setting_set $app mysqlpwd $dbpass
ynh_app_setting_set $app adminusername $admin
ynh_app_setting_set $app is_public $is_public
# Create tmp directory and install app inside
TMPDIR=`mktemp -d`
extract_application "$TMPDIR"
sudo mv "$TMPDIR" "$DESTDIR"
extract_application "$DESTDIR"
# Copy and edit config.php
sudo cp ../conf/config.php ${DESTDIR}

View file

@ -39,11 +39,7 @@ sudo rm -rf /var/lib/php5/session/*
# Move old app dir
sudo mv ${DESTDIR} ${DESTDIR}.old
# Create tmp directory and install app inside
TMPDIR=`mktemp -d`
extract_application "$TMPDIR"
sudo mv "$TMPDIR" "$DESTDIR"
extract_application "$DESTDIR"
# restore data
sudo cp -a ${DESTDIR}.old/data ${DESTDIR}