From e4f08bd4be437f0f439dba121f9926b9bd6e859c Mon Sep 17 00:00:00 2001
From: Kayou <pierre.moltess@gmail.com>
Date: Tue, 5 Mar 2019 23:11:52 +0100
Subject: [PATCH] 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