Created
January 9, 2020 04:18
-
-
Save vmitchell85/c1aa8c03e0a5aed62caaa661d161024b to your computer and use it in GitHub Desktop.
A little function to delete all your vendor folders where a composer.lock file exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nukecomposer() { | |
find . -name "vendor" -type d -maxdepth 2 -print0 | | |
while IFS= read -r -d '' vendorDir; do | |
lockfile=${vendorDir/vendor/"composer.lock"}; | |
if test -f $lockfile; then | |
echo 'Deleting vendor directory: ' $vendorDir | |
rm -rf $vendorDir | |
fi | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment