mes/scripts/include.mes
Jan Nieuwenhuizen 323e78b190 Prepare for 0.1 release: installable scripts.
* scripts/mes: New symlink.
* scripts/elf.mes: Use it.
* scripts/mescc.mes: Likewise, read all mes modules with include.mes.
* scripts/paren.mes: Likewise.
* scripts/repl.mes: Likewise.
2016-10-16 08:00:04 +02:00

12 lines
311 B
Bash
Executable file

#! /bin/sh
for prefix in $(dirname $(dirname $0))/share/mes . $(dirname $(dirname $0)); do
if [ -d ${prefix}/module ]; then
break;
fi
done
cat $1 \
| grep -Eo '(mes-use-module \([^()]+ [^()]+))' \
| grep -Eo ' \([^)]+\)' \
| sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'