Last active
July 25, 2022 13:35
-
-
Save bperel/d336ad7669406581bd550d1d5d8462ad to your computer and use it in GitHub Desktop.
FV LOC
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
#!/bin/bash | |
# shellcheck disable=SC2034 | |
src='\033[0;32m' | |
applications_sv_app_firstvet_com='\033[0;36m' | |
applications_app_firstvet_com='\033[0;35m' | |
NC='\033[0m' # No Color | |
dirs=( "." "applications/app.firstvet.com" "applications/sv.app.firstvet.com" ) | |
setColor() { | |
dir_norm=$(echo "$1" | sed "s/[\/.]/_/g") | |
color=${!dir_norm} | |
} | |
for dir in "${dirs[@]}"; do | |
setColor "$dir" | |
echo -e "${color}| $dir" | |
done | |
echo -ne "${NC}" | |
for dir in "${dirs[@]}"; do | |
setColor "$dir" | |
count=$( ( cd "$dir" && find . -name '*.php' -not -path './.mysql-data/*' -not -path './applications/*' -not -path './vendor/*' -not -path './node_modules/*' -not -path './*/storage/*' -print0 | xargs -0 cat ) | wc -l) | |
length=$(( $((count / 1000)) - ${#count} )) | |
for ((i=0; i < length; i++)); do | |
echo -en "${color}|" | |
if [ "$i" -eq $((length / 2)) ]; then | |
echo -n "$count" | |
fi | |
done | |
echo -en "${NC}" | |
done | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment