Skip to content

Instantly share code, notes, and snippets.

@DanielJette
Created May 26, 2019 20:55
Show Gist options
  • Save DanielJette/e313b32f40428e91c2af4a0bfe761ac2 to your computer and use it in GitHub Desktop.
Save DanielJette/e313b32f40428e91c2af4a0bfe761ac2 to your computer and use it in GitHub Desktop.
Simple script to count java and kotlin files in a project
#!/bin/sh
if [ -z "$1" ]; then
echo "Please specify a project"
echo " e.g. show_lang.sh Polaris/Core"
exit 1
fi
BASEDIR=$(dirname "$0")
pushd "${BASEDIR}/../$1" > /dev/null 2>&1
cd src > /dev/null 2>&1
JAVA=`find . | grep --color=no "\.java$" | wc -l`
echo ""
echo "$1:"
echo " Java files: $JAVA"
KOTLIN=`find . | grep --color=no "\.kt$" | wc -l`
echo " Kotlin files: $KOTLIN"
popd > /dev/null 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment