mirror of
https://github.com/YunoHost-Apps/nodered_ynh.git
synced 2024-09-03 19:46:25 +02:00
Make sure files are own by app and optimize NodeJS installation/removal
This commit is contained in:
parent
b38178d683
commit
89ed619e35
2 changed files with 7 additions and 5 deletions
|
@ -94,6 +94,7 @@ ynh_system_user_create --username=$app --home_dir=$final_path
|
||||||
ynh_script_progression --message="Installing Node-RED..." --weight=2
|
ynh_script_progression --message="Installing Node-RED..." --weight=2
|
||||||
|
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
|
chown -R $app: "$final_path"
|
||||||
|
|
||||||
pushd $final_path
|
pushd $final_path
|
||||||
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install --production
|
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install --production
|
||||||
|
|
|
@ -73,10 +73,6 @@ if ! ynh_permission_exists --permission="admin"; then
|
||||||
ynh_permission_create --permission="admin" --url="/admin" --label="admin" --show_tile=true
|
ynh_permission_create --permission="admin" --url="/admin" --label="admin" --show_tile=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(ynh_app_setting_get --app=$app --key=nodejs_version) != $nodejs_version) ]; then
|
|
||||||
ynh_remove_nodejs
|
|
||||||
fi
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# CLOSING PORT
|
# CLOSING PORT
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -102,7 +98,10 @@ ynh_systemd_action --service_name=$app --action="stop"
|
||||||
# INSTALL NODEJS
|
# INSTALL NODEJS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_install_nodejs --nodejs_version=$nodejs_version
|
if [ $(ynh_app_setting_get --app=$app --key=nodejs_version) != $nodejs_version ]; then
|
||||||
|
ynh_remove_nodejs
|
||||||
|
ynh_install_nodejs --nodejs_version=$nodejs_version
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
|
@ -131,6 +130,8 @@ ynh_script_progression --message="Installing Node-RED..." --weight=30
|
||||||
|
|
||||||
ynh_use_nodejs
|
ynh_use_nodejs
|
||||||
|
|
||||||
|
chown -R $app: "$final_path"
|
||||||
|
|
||||||
pushd $final_path
|
pushd $final_path
|
||||||
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install --production
|
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install --production
|
||||||
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install node-red-dashboard
|
ynh_exec_warn_less exec_as $app $ynh_node_load_PATH $ynh_npm install node-red-dashboard
|
||||||
|
|
Loading…
Add table
Reference in a new issue