tests: avoid reliance on nullglob

Some shells do not have a nullglob feature, including dash (default
/bin/sh on Ubuntu) and the Almquist shell (default /bin/sh on
FreeBSD).  An mv(1) command in setup_dir is failing due to a glob
not matching anything, so use a more widely supported construction.
master
Fraser Tweedale 2014-02-21 19:21:03 +10:00
parent 0f709eafa0
commit 8925419e90
1 changed files with 4 additions and 3 deletions

View File

@ -5,8 +5,9 @@
# Back up
type setopt >/dev/null 2>&1 && setopt NULL_GLOB
type shopt >/dev/null 2>&1 && shopt -s nullglob
mkdir -p bak
mv v* src alias bak || sleep 0s
for SRC in v* src alias; do
[ -e "$SRC" ] && mv "$SRC" bak
done
true
)