#!/bin/bash

ROOT=$(git rev-parse --show-toplevel)

find $ROOT -name '*.py' | xargs etags -o ${ROOT}/TAGS
if [ -n "$VIRTUAL_ENV" ]; then
  find ${VIRTUAL_ENV}/lib -name '*.py' |xargs etags -a -o ${ROOT}/TAGS
else
    echo "No Virtual env enabled, will not add it to TAGS"
fi

find $ROOT/apps/wolnelektury_core/static/css -name '*.css' |xargs etags -a -o ${ROOT}/TAGS
find $ROOT/apps/wolnelektury_core/static/js -name '*.js' |xargs etags -a -o ${ROOT}/TAGS