Skip to content

Commit

Permalink
Add -all option for 'yarn clean' to help with node_modules issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Jan 30, 2025
1 parent af8f5d3 commit 86d2184
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion utils/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,30 @@ MYPATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# ROOT is the root directory of our project.
ROOT="$MYPATH/.."

pushd "$ROOT"
pushd "$ROOT" >/dev/null 2>&1

CLEAN_ALL=false
while [[ $# -gt 0 ]]; do
case $1 in
-a|--all)
CLEAN_ALL=true
shift # past argument
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done

rm -rf packages/*/dist
rm -rf .nyc_output/
rm -rf coverage/
rm -rf cypress/
rm -rf packages/*/*.tsbuildinfo
rm -rf storybook-static/

if [[ "$CLEAN_ALL" == "true" ]]; then
echo "Removing node_modules directories. You'll need to 'yarn install' after this."
find . -name node_modules -and -type d -prune -exec rm -rf '{}' \;
fi

0 comments on commit 86d2184

Please sign in to comment.