Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A little function to delete all your vendor folders where a composer.lock file exists
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