From 7851502ad0843e9c6eb3cf69aaaf525d98c25788 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 16 Sep 2023 14:01:45 +0200 Subject: [PATCH] Cleanup to save disk space --- scripts/install | 6 ++++++ scripts/upgrade | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index 11a984d..2f37431 100755 --- a/scripts/install +++ b/scripts/install @@ -55,6 +55,12 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build popd +# Cleanup after install +ynh_secure_remove --file="$install_dir/.cache" +ynh_secure_remove --file="$install_dir/.npm/_cacache" +ynh_secure_remove --file="$install_dir/node_modules" +ynh_secure_remove --file="$install_dir/frontend/node_modules" + chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index f84c432..186b1ad 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,6 +43,12 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" +# Cleanup after install +ynh_secure_remove --file="$install_dir/.cache" +ynh_secure_remove --file="$install_dir/.npm/_cacache" +ynh_secure_remove --file="$install_dir/node_modules" +ynh_secure_remove --file="$install_dir/frontend/node_modules" + #================================================= # NGINX CONFIGURATION #=================================================