From 82f0224d690825720167ded2331eb4699c2d5a5b Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 16 Apr 2020 16:08:39 +0200 Subject: [PATCH] [add] g++ dependency --- scripts/_common.sh | 3 +++ scripts/install | 6 +++++- scripts/remove | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index ac79128..38aa8ed 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,9 @@ nodejs_version=12 +# dependencies used by the app +pkg_dependencies="g++" + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 0ffc6a7..d110514 100644 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,7 @@ type zerotier > /dev/null || echo "ZeroTier is needed, but it is not installed. ### If the app uses nginx as web server (written in HTML/PHP in most cases), the final path should be "/var/www/$app". ### If the app provides an internal web server (or uses another application server such as uwsgi), the final path should be "/opt/yunohost/$app" -final_path=/opt/key-networks/ztncui +final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" # Register (book) web path @@ -108,6 +108,8 @@ ynh_script_progression --message="Installing dependencies..." --time --weight=1 ### - As well as the section "REINSTALL DEPENDENCIES" in the restore script ### - And the section "UPGRADE DEPENDENCIES" in the upgrade script +ynh_install_app_dependencies $pkg_dependencies + ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs @@ -150,7 +152,9 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Performing Node app installation..." --time --weight=1 pushd $final_path/src + npm install -g node-gyp npm install + npm audit fix popd #================================================= diff --git a/scripts/remove b/scripts/remove index b201fd3..c057776 100644 --- a/scripts/remove +++ b/scripts/remove @@ -38,6 +38,8 @@ fi #================================================= ynh_script_progression --message="Removing dependencies..." --time --weight=1 +# Remove metapackage and its dependencies +ynh_remove_app_dependencies ynh_remove_nodejs #=================================================