From abb793b2ae51f4a36d3e3f0d32e6bbf32072ed4d Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Thu, 26 Jun 2025 20:17:55 +0100 Subject: [PATCH] fix: Ensure root node_modules are removed before processing subdirectories --- remove-node-modules.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/remove-node-modules.sh b/remove-node-modules.sh index 567450623e..7dc478c3c7 100644 --- a/remove-node-modules.sh +++ b/remove-node-modules.sh @@ -3,6 +3,14 @@ echo "Removing node_modules directories..." +# Remove node_modules in root directory first +if [ -d "node_modules" ]; then + echo "Removing node_modules in root directory" + rm -rf node_modules || echo "Failed to remove node_modules in root directory" +else + echo "No node_modules found in root directory" +fi + for d in */ ; do if [ -d "$d" ]; then cd "$d" || { echo "Cannot cd into $d"; continue; }