Newer
Older
dub_jkp / test / issue895-local-configuration.sh
@Martin Nowak Martin Nowak on 4 Jul 2017 610 bytes replace all usages of `exit`
#!/usr/bin/env bash
. $(dirname "${BASH_SOURCE[0]}")/common.sh

cd ${CURR_DIR}
mkdir ../etc
mkdir ../etc/dub
echo "{\"defaultCompiler\": \"foo\"}" > ../etc/dub/settings.json

if [ -e /var/lib/dub/settings.json ]; then
	die $LINENO 'Found existing system wide DUB configuration. Aborting.'
fi

if [ -e ~/.dub/settings.json ]; then
	die $LINENO 'Found existing user wide DUB configuration. Aborting.'
fi

if ! { ${DUB} describe --single issue103-single-file-package.d 2>&1 || true; } | grep -cF 'Unknown compiler: foo'; then
	rm -r ../etc
	die $LINENO 'DUB did not find the local configuration'
fi

rm -r ../etc