From 1d4f644980ade4c7b62d4bc318baf80469ca14db Mon Sep 17 00:00:00 2001 From: Nicolas Frandeboeuf Date: Tue, 10 Jan 2023 08:18:05 +0000 Subject: [PATCH] Clean yarn cache on install/upgrade to save disk space --- scripts/install | 3 +++ scripts/upgrade | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 950a52e..3021d7f 100644 --- a/scripts/install +++ b/scripts/install @@ -148,6 +148,9 @@ pushd "$final_path" pushd "ghost/admin" ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME="$final_path" yarn build --environment/production # well, except for the admin popd + + # Clean yarn cache (which takes a lot of disk space) + rm ./.cache/yarn/* -rf popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 80d876c..967b2bf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -193,9 +193,12 @@ then ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME="$final_path" yarn install --non-interactive ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME="$final_path" yarn add knex-migrator ember-cli --dev --ignore-workspace-root-check --non-interactive ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME="$final_path" yarn setup - pushd "ghost/admin" + pushd "ghost/admin" ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH HOME="$final_path" yarn build --environment/production popd + + # Clean yarn cache (which takes a lot of disk space) + rm ./.cache/yarn/* -rf popd fi