From 5290d40d1b794583debe9c82e0afac2636dee578 Mon Sep 17 00:00:00 2001 From: Tobias Ollive Date: Fri, 11 Jun 2021 12:42:56 +0200 Subject: [PATCH] set port in config file --- scripts/install | 3 +++ scripts/upgrade | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/scripts/install b/scripts/install index 15f2345..14c33c5 100644 --- a/scripts/install +++ b/scripts/install @@ -95,6 +95,9 @@ ynh_system_user_create --username=$app --home_dir=$final_path ynh_script_progression --message="Installing application using node..." pushd $final_path +# set port in configuration file + sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json + sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json # use custom home value to avoid bower storing values in root and have right errors [[ -v HOME ]] && TMP_HOME=$HOME HOME=$(pwd) diff --git a/scripts/upgrade b/scripts/upgrade index 9556209..74be857 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,6 +84,10 @@ ynh_install_nodejs --nodejs_version=$NODEJS_VERSION ynh_script_progression --message="Upgrading the app..." --weight=5 pushd $final_path +# set port in configuration file + sed -i "/HTTP_PORT/s/[0-9]*[0-9]/$port/" package.json + sed -i "/HTTPS_PORT/s/[0-9]*[0-9]/$https_port/" package.json + TMP_HOME=$HOME HOME=$(pwd) ynh_use_nodejs