Handle missing files more gracefully. (#265)

* Wrote functional tests for desired behavior.

Redoing the pull request, starting from current master.

The tests now fail where expected.

* Updated commands to handle missing files better.

The functional tests now pass.
This commit is contained in:
Jack Twilley 2016-08-24 01:06:59 -07:00 committed by Thomas VIAL
parent f707a11c98
commit 6d2d9dd738
5 changed files with 107 additions and 18 deletions

View file

@ -9,7 +9,7 @@ function usage {
if [ ! -z "$1" ]; then
USER=$1
if [ ! -z "$(grep $USER -i $DATABASE)" ]; then
if [ -e "$DATABASE" ] && [ ! -z "$(grep $USER -i $DATABASE)" ]; then
echo "User already exists"
exit 1
fi