forked from code-dot-org/code-dot-org
-
Notifications
You must be signed in to change notification settings - Fork 0
Scripts
Dayne edited this page Feb 1, 2020
·
2 revisions
git ls-files | awk '{print tolower()}' | awk -F '/' '{print $NF}' | awk -F '.' '{print $NF}' | sort | uniq -c | sort -n
-
git ls-files- Lists all files in the current git repo. -
awk '{print tolower()}'- prints the file path to lower case. -
awk -F '/' '{print $NF}'- splits the file path by '/' and prints the last item in the path. -
awk -F '.' '{print $NF}'- splits the file by '.' and prints the file extension (last item) -
sort- sorts the file extensions so the followinguniqcan aggregate them. -
uniq -c- aggregates the file extensions into a count and prints thecount + file_extension -
sort -n- sorts the counts by numerical value.
git ls-files | grep -i '.*\.\(js\|jsx\|css\|scss\|rb\|erb\|haml\|feature\)$' | entr -scr 'echo "hello"'
-
git ls-files- Lists all files in the current git repo. -
grep -i '.*\.\(js\|jsx\|css\|scss\|rb\|erb\|haml\|feature\)$'- filters the file extensions we are interested in. -
entr -scr 'echo "hello"'-entrwatches the given filepaths for changes and then runs the given command