Created
July 10, 2019 16:15
-
-
Save joshavant/ac5834a68a9f0e7b418bd8f5526cb5df to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
project=.; | |
objc=`grep -r "^@implementation " $project | wc -l | tr -d ' '`; | |
swift=`grep -r "^class " $project | wc -l | tr -d ' '`; | |
ratio=$(bc <<< "scale=3; $swift / $objc"); | |
ratio_perc=$(bc <<< "$ratio * 100"); | |
echo "Swift classes: $swift"; | |
echo "Objective-C classes: $objc"; | |
printf "Ratio: %0.3g%%\n" $ratio_perc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment