From e4f08bd4be437f0f439dba121f9926b9bd6e859c Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 5 Mar 2019 23:11:52 +0100 Subject: [PATCH 1/2] Use the same dependencies variable --- scripts/_common.sh | 3 +++ scripts/install | 3 ++- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b905339..42570a3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,9 @@ # PERSONAL HELPERS #================================================= +# dependencies used by the app +pkg_dependencies="deb1 deb2" + #================================================= # EXPERIMENTAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 1f0eb0d..e68d79b 100755 --- a/scripts/install +++ b/scripts/install @@ -97,10 +97,11 @@ ynh_print_info "Installing dependencies..." ### Those deb packages will be installed as dependencies of this package. ### If you're not using this helper: ### - Remove the section "REMOVE DEPENDENCIES" in the remove script +### - Remove the variable "pkg_dependencies" in _common.sh ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script -ynh_install_app_dependencies deb1 deb2 +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A MYSQL DATABASE diff --git a/scripts/restore b/scripts/restore index 6458fb5..fb5dd4b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -87,7 +87,7 @@ ynh_restore_file "/etc/php/7.0/fpm/pool.d/$app.conf" ynh_print_info "Reinstalling dependencies..." # Define and install dependencies -ynh_install_app_dependencies deb1 deb2 +ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 4b4393b..d0630cc 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -94,7 +94,7 @@ ynh_add_nginx_config #================================================= ynh_print_info "Upgrading dependencies..." -ynh_install_app_dependencies deb1 deb2 +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER From 7219f5a3b83a04dcdb7aaa7678d09971387a5e4f Mon Sep 17 00:00:00 2001 From: Kayou Date: Tue, 5 Mar 2019 23:17:15 +0100 Subject: [PATCH 2/2] New section --- scripts/_common.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 42570a3..8bb05b4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,12 +1,16 @@ #!/bin/bash #================================================= -# PERSONAL HELPERS +# COMMON VARIABLES #================================================= # dependencies used by the app pkg_dependencies="deb1 deb2" +#================================================= +# PERSONAL HELPERS +#================================================= + #================================================= # EXPERIMENTAL HELPERS #=================================================