You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
BEFORE="./before.tmp"
|
|
|
|
AFTER="./after.tmp"
|
|
|
|
|
|
|
|
cleanup () { rm -f "${BEFORE}" "${AFTER}"; }
|
|
|
|
die () { echo "$@" ; cleanup ; exit 1; }
|
|
|
|
|
|
|
|
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}"
|
|
|
|
|
|
|
|
\. ../../nvm.sh
|
|
|
|
|
|
|
|
type nvm > /dev/null 2>&1 || die "nvm not loaded"
|
|
|
|
|
|
|
|
nvm unload
|
|
|
|
|
|
|
|
typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}"
|
|
|
|
|
|
|
|
! type nvm > /dev/null 2>&1 || die "nvm not unloaded"
|
|
|
|
|
|
|
|
DIFF="$(diff "${BEFORE}" "${AFTER}" ||:)"
|
|
|
|
[ -z "${DIFF}" ] || die "function pollution found: ${DIFF}"
|
|
|
|
|
|
|
|
cleanup
|