Skip to content

Instantly share code, notes, and snippets.

@joshavant
Created July 10, 2019 16:15
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 joshavant/ac5834a68a9f0e7b418bd8f5526cb5df to your computer and use it in GitHub Desktop.
Save joshavant/ac5834a68a9f0e7b418bd8f5526cb5df to your computer and use it in GitHub Desktop.
#!/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