-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
languages.sh
executable file
·36 lines (31 loc) · 985 Bytes
/
languages.sh
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
#!/usr/bin/env bash
set -euo pipefail
pushd "$(dirname "${0}")/.." > /dev/null
FOLDERS=$(find . -name 'problem.md' | sed 's/problem.md//g' | sort)
for folder in ${FOLDERS}; do
solutions="$(\
find "${folder}" \
-name '*.c' -o \
-name '*.clj' -o \
-name '*.cpp' -o \
-name '*.cs' -o \
-name '*.dart' -o \
-name '*.go' -o \
-name '*.hs' -o \
-name '*.java' -o \
-name '*.js' -o \
-name '*.kt' -o \
-name '*.lua' -o \
-name '*.ml' -o \
-name '*.pas' -o \
-name '*.php' -o \
-name '*.py' -o \
-name '*.r' -o \
-name '*.rb' -o \
-name '*.rs' -o \
-name '*.scala' -o \
-name '*.sql' | \
grep -Ev 'drop-table.sql|schema.sql')"
echo "$(echo "${solutions}" | wc -w | sed 's/ //g') ${folder}"
done | sort -nr
popd > /dev/null