| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
# notice the / at end in order to load this module |
| 4 |
PACKAGE='punycode' |
| 5 |
SEDCMD="s,require\s*[(]\s*'[.][.]/?([^']*)'\s*[)],require('$PACKAGE/\1'),g" |
| 6 |
|
| 7 |
tmpdir=$(mktemp -d) |
| 8 |
trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP |
| 9 |
|
| 10 |
cp -r tests/ $tmpdir/tests |
| 11 |
find tests/ -name '*.js' -print0 | \ |
| 12 |
xargs -0 -n1 \ |
| 13 |
sh -c 'set -e; echo "Create: $3"; sed -E "$1" < "$3" > "$2/$3"' sedtape "$SEDCMD" "$tmpdir" |
| 14 |
# avoid false that does not work outside build dir |
| 15 |
mocha -R spec $tmpdir/tests/*.js |