mirror of
https://github.com/YunoHost-Apps/wikijs_ynh.git
synced 2024-09-03 20:36:09 +02:00
Update ynh_install_nodejs
This commit is contained in:
parent
fe32f20d05
commit
7f59bfef63
1 changed files with 5 additions and 4 deletions
|
@ -50,7 +50,7 @@ export NODENV_ROOT="$nodenv_install_dir"
|
||||||
#
|
#
|
||||||
# usage: ynh_use_nodejs
|
# usage: ynh_use_nodejs
|
||||||
#
|
#
|
||||||
# Requires YunoHost version 2.7.12 or higher.
|
# Requires YunoHost version 3.2.2 or higher.
|
||||||
ynh_use_nodejs () {
|
ynh_use_nodejs () {
|
||||||
nodejs_version=$(ynh_app_setting_get --app=$app --key=nodejs_version)
|
nodejs_version=$(ynh_app_setting_get --app=$app --key=nodejs_version)
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@ ynh_use_nodejs () {
|
||||||
fi
|
fi
|
||||||
# Create an alias to easily load the PATH
|
# Create an alias to easily load the PATH
|
||||||
ynh_node_load_PATH="PATH=$PATH"
|
ynh_node_load_PATH="PATH=$PATH"
|
||||||
|
# Same var but in lower case to be compatible with ynh_replace_vars...
|
||||||
ynh_nodejs_load_path="PATH=$PATH"
|
ynh_nodejs_load_path="PATH=$PATH"
|
||||||
|
|
||||||
# Sets the local application-specific Node.js version
|
# Sets the local application-specific Node.js version
|
||||||
|
@ -96,7 +97,7 @@ ynh_use_nodejs () {
|
||||||
# usage: ynh_install_nodejs --nodejs_version=nodejs_version
|
# usage: ynh_install_nodejs --nodejs_version=nodejs_version
|
||||||
# | arg: -v, --nodejs_version= - Version of Node.js to install.
|
# | arg: -v, --nodejs_version= - Version of Node.js to install.
|
||||||
#
|
#
|
||||||
# Requires YunoHost version 2.7.12 or higher.
|
# Requires YunoHost version 3.2.2 or higher.
|
||||||
ynh_install_nodejs () {
|
ynh_install_nodejs () {
|
||||||
# Declare an array to define the options of this helper.
|
# Declare an array to define the options of this helper.
|
||||||
local legacy_args=v
|
local legacy_args=v
|
||||||
|
@ -261,7 +262,7 @@ ynh_remove_nodejs () {
|
||||||
ynh_cleanup_nodejs () {
|
ynh_cleanup_nodejs () {
|
||||||
|
|
||||||
# List required Node.js versions
|
# List required Node.js versions
|
||||||
local installed_apps=$(yunohost app list | grep -oP 'id: \K.*$')
|
local installed_apps=$(yunohost app list --output-as json --quiet | jq -r .apps[].id)
|
||||||
local required_nodejs_versions=""
|
local required_nodejs_versions=""
|
||||||
for installed_app in $installed_apps
|
for installed_app in $installed_apps
|
||||||
do
|
do
|
||||||
|
@ -296,6 +297,6 @@ ynh_cleanup_nodejs () {
|
||||||
ynh_secure_remove --file="$n_install_dir"
|
ynh_secure_remove --file="$n_install_dir"
|
||||||
ynh_secure_remove --file="/usr/local/n"
|
ynh_secure_remove --file="/usr/local/n"
|
||||||
sed --in-place "/$n_install_dir/d" /root/.bashrc
|
sed --in-place "/$n_install_dir/d" /root/.bashrc
|
||||||
rm --force /etc/cron.daily/node_update
|
ynh_secure_remove --file="/etc/cron.daily/node_update"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue