Skip to content

Instantly share code, notes, and snippets.

View thiagocordeiro's full-sized avatar
🥵
Melting

Thiago Cordeiro thiagocordeiro

🥵
Melting
View GitHub Profile
@thiagocordeiro
thiagocordeiro / check-file-size.sh
Created November 26, 2021 14:03
check-file-size.sh
#!/bin/bash
echo "$(git ls-files | xargs cat | wc -l | xargs) Lines of code"
RESULT=$(wc -l $(git ls-files) | grep .php | grep -v "tests/" | awk '{ if ( $1 > 250 ) printf("%-6s | %s \n\r", $1, $2) }')
if [ -n "$RESULT" ]; then
awk 'BEGIN {s=sprintf("%131s","");gsub(/ /,"-",s);print s}'
echo "LINE | FILE"
awk 'BEGIN {s=sprintf("%131s","");gsub(/ /,"-",s);print s}'
echo $RESULT
awk 'BEGIN {s=sprintf("%131s","");gsub(/ /,"-",s);print s}'