From 7e5d7fac574789def3d4b62a9a255ac32bcaa88d Mon Sep 17 00:00:00 2001 From: Yuanle Song Date: Fri, 27 Jan 2017 22:11:18 +0800 Subject: [PATCH] add print-loc.sh --- print-loc.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 print-loc.sh diff --git a/print-loc.sh b/print-loc.sh new file mode 100755 index 0000000..6e18c4b --- /dev/null +++ b/print-loc.sh @@ -0,0 +1,14 @@ +#!/bin/sh +print_help_and_exit() { + echo "Usage: ./print-loc" + exit 1 +} + +# main() +if [ "$1" = "--help" ]; then + print_help_and_exit +fi +cloc --exclude-dir vendor . +if [ $? -ne 0 ]; then + echo "Error: require cloc program. Try sudo apt-get install -y cloc" +fi -- GitLab