Skip to content

Commit

Permalink
chore(bin): add clean script
Browse files Browse the repository at this point in the history
  • Loading branch information
bludnic committed May 22, 2024
1 parent eb22dc8 commit 9ab8286
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bin/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Function to remove specified directories
remove_directories() {
local dir=$1
local dirs_to_remove=("node_modules" "dist" ".next" ".turbo")
for sub_dir in "${dirs_to_remove[@]}"; do
if [ -d "$dir/$sub_dir" ]; then
echo "Removing ${dir%/}/$sub_dir..."
rm -rf "${dir%/}/$sub_dir"
fi
done
}

# Remove directories in root
remove_directories .

# Remove directories in apps/{appName}
for dir in pro/*/; do
remove_directories "$dir"
done

# Remove directories in packages/{packageName}
for dir in packages/*/; do
remove_directories "$dir"
done

echo "All specified directories have been removed."

0 comments on commit 9ab8286

Please sign in to comment.