Fix permission in the install_dir to that npm can install
This commit is contained in:
parent
d180592b9d
commit
23546d9cd2
2 changed files with 7 additions and 0 deletions
|
@ -149,6 +149,11 @@ ynh_setup_my_nodeapp() {
|
||||||
ynh_add_config --template="nginx-nodejs.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_add_config --template="nginx-nodejs.conf" --destination="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"
|
ynh_store_file_checksum --file="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
ynh_systemd_action --service_name=nginx --action=reload
|
ynh_systemd_action --service_name=nginx --action=reload
|
||||||
|
|
||||||
|
# Subsequent npm install will write to this folder (as it is within $app's home)
|
||||||
|
# As such we prepare it with fitting rights
|
||||||
|
mkdir -p "$install_dir/.npm"
|
||||||
|
chown $app:$app "$install_dir/.npm"
|
||||||
}
|
}
|
||||||
|
|
||||||
ynh_remove_my_nodeapp() {
|
ynh_remove_my_nodeapp() {
|
||||||
|
|
|
@ -90,6 +90,8 @@ then
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs-watcher.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs-watcher.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs-watcher.path"
|
ynh_restore_file --origin_path="/etc/systemd/system/${app}-nodejs-watcher.path"
|
||||||
|
mkdir -p "$install_dir"/.npm
|
||||||
|
chown -R $app:$app "$install_dir"/.npm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue