From c9af2d0dc77ba2072014d10a13cf7a21c4acbbb7 Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Thu, 27 Apr 2017 10:26:35 +0200 Subject: [PATCH] Install dependencies when restoring --- scripts/_common.sh | 7 +++++++ scripts/restore | 12 +++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ab6cdcc..58d8c12 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -70,6 +70,13 @@ extract_wallabag() { || ynh_die "Unable to apply patches to Wallabag" } +WARNING () { # Print on error output + $@ >&2 +} + +QUIET () { # redirect standard output to /dev/null + $@ > /dev/null +} HUMAN_SIZE () { # Transforms a Kb-based size to a human-readable size human=$(numfmt --to=iec --from-unit=1K $1) diff --git a/scripts/restore b/scripts/restore index d2cf224..4f717de 100644 --- a/scripts/restore +++ b/scripts/restore @@ -34,17 +34,19 @@ db_name=$(ynh_app_setting_get $app db_name) CHECK_DOMAINPATH # Check domain and path availability CHECK_FINALPATH # Check if destination directory is not already in use +#================================================= +# INSTALL DEPENDENCIES +#================================================= + +ynh_install_app_dependencies "$PKG_DEPENDENCIES" + #================================================= # STANDARD RESTORE STEPS #================================================= # RESTORE NGINX CONFIGURATION #================================================= -conf=/etc/nginx/conf.d/$domain.d/$app.conf -if [ -f $conf ]; then - ynh_die "There is already a nginx conf file at this path: $conf " -fi -sudo cp -a ./nginx.conf $conf +sudo cp -a ./nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf #================================================= # RESTORE APP MAIN DIR