summaryrefslogtreecommitdiffstats
path: root/scripts/unused-js-functions.sh
blob: 4786bbec913bdfd5456735d3df2181661e107162 (plain)
1
2
3
4
5
6
7
8
9
10
#! /bin/bash

find browser/src/ -name "*.js" -exec grep ': function' \{\} \; | sed -e 's/:.*//' -e 's/^[\t ]*//' -e 's/[\t ]*$//' | grep -v " " | sort | uniq | \
    while read FUNC ; do
        NUM=`git grep "\<$FUNC\>" browser/src/ | wc -l`
        #echo "Trying $FUNC: $NUM"
        if [ "$NUM" = "1" ] ; then
            git --no-pager grep "\<$FUNC\>" browser/src/
        fi
    done