forked from DavidSkrundz/Lua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLOC.command
executable file
·42 lines (28 loc) · 1.46 KB
/
LOC.command
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# Count the number of lines in the Swift project
# cd to the directory where this file is located
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
# move the cursor to the top of the terminal
tput reset
# define some colors
Yellow='\033[1;33m'
Red='\033[1;31m'
Blue='\033[1;34m'
Reset='\033[0m'
printf "================================================================================\n"
printf " ${Yellow}Meta${Reset} \n"
printf "================================================================================\n"
find . \( -ipath ./*.swift -o -ipath ./Tests/*.swift \) -exec wc -l '{}' \+
printf "\n"
printf "================================================================================\n"
printf " ${Red}Swift${Reset} \n"
printf "================================================================================\n"
find . \( -ipath "./Sources/*.swift" \) -exec wc -l '{}' \+
printf "\n"
printf "================================================================================\n"
printf " ${Blue}Tests${Reset} \n"
printf "================================================================================\n"
find . \( -ipath "./Tests/*/*.swift" \) -exec wc -l '{}' \+
printf "\n"
read -n1 -r -p "Press any key to continue..." key