Skip to content

Instantly share code, notes, and snippets.

@vmitchell85
Created January 9, 2020 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmitchell85/c1aa8c03e0a5aed62caaa661d161024b to your computer and use it in GitHub Desktop.
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
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