Last active
August 15, 2023 21:16
-
-
Save Nyholm/317df136ded2087649d0c9c464285cb1 to your computer and use it in GitHub Desktop.
Show who contributed to your vendors folder
This file contains 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
# Install git fame | |
gem install git_fame | |
# Install all vendors with source | |
rm -rf vendor/* | |
composer update --prefer-source | |
# Do the calculations. This might take 30 minutes to complete. | |
rm output.txt | |
find ./vendor -type d -depth 2 ! -path "./vendor/composer" -exec echo {} \; -exec git fame --sort=loc --hide-progressbar --repository={} \; >> output.txt | |
# Print the result | |
awk -F "|" '/\|.*\| [0-9]/ {gsub(/[ \t]+$/, "", $2); print $2 "|" $3}' output.txt | awk -F "|" '{ arr[$1]+=$2 } END { for (key in arr) printf("%s\t%s\n", arr[key], key) }' | sort -r -g > output_sorted.txt | |
cat output_sorted.txt | grep Nyholm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wouldn’t it be better to do a
composer install --prefer-source
instead of anupdate
? Otherwise the composer.lock file will be ignored and overwritten.