Add paredit workaround in scripts.
[mes.git] / scripts / include.mes
1 #! /bin/sh
2
3 if [ "$1" == "--help" ]; then
4     echo "Usage: include.mes FILE"
5     exit 0
6 fi
7 for prefix in $(dirname $(dirname $0))/share/mes . $(dirname $(dirname $0)); do
8     if [ -d ${prefix}/module ]; then
9         break;
10     fi
11 done
12 cat $1 \
13   | grep -Eo '(mes-use-module \([^()]+ [^()]+))' \
14   | grep -Eo ' \([^)]+\)' \
15   | sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'