From 1f48765105a3726f2a915ce5e19e6186e8299deb Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Mon, 28 Aug 2023 21:29:13 +0200 Subject: [PATCH] Sync assemble of 20 with 20-minimal This makes the cache clearning working, otherwise the command creates some debug log inside of after the is cleared. That makes the test test_npm_cache_cleared to fail. --- 20-minimal/s2i/bin/assemble | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/20-minimal/s2i/bin/assemble b/20-minimal/s2i/bin/assemble index 78c9b975..d6ff098e 100755 --- a/20-minimal/s2i/bin/assemble +++ b/20-minimal/s2i/bin/assemble @@ -95,6 +95,12 @@ else echo "---> Pruning the development dependencies" npm prune + NPM_TMP=$(npm config get tmp) + if ! mountpoint $NPM_TMP; then + echo "---> Cleaning the $NPM_TMP/npm-*" + rm -rf $NPM_TMP/npm-* + fi + # Clear the npm's cache and tmp directories only if they are not a docker volumes NPM_CACHE=$(npm config get cache) if ! mountpoint $NPM_CACHE; then @@ -104,12 +110,6 @@ else # We do not want to delete .npmrc file. rm -rf "${NPM_CACHE:?}/" fi - NPM_TMP=$(npm config get tmp) - if ! mountpoint $NPM_TMP; then - echo "---> Cleaning the $NPM_TMP/npm-*" - rm -rf $NPM_TMP/npm-* - fi - fi # Fix source directory permissions