fix: Ensure root node_modules are removed before processing subdirectories

This commit is contained in:
Simon Larsen 2025-06-26 20:17:55 +01:00
parent 3119b8cfc2
commit abb793b2ae
No known key found for this signature in database
GPG key ID: 96C5DCA24769DBCA

View file

@ -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; }