From f5f900a6e7e8cf32ac677fc9d3209e61acda2e76 Mon Sep 17 00:00:00 2001 From: Joel Bradshaw Date: Thu, 19 Nov 2020 17:44:46 -0800 Subject: [PATCH] Figured out a way to give a nice error message This way if we fail to parse old .env's folks should be able to figure it out --- bw-dev | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bw-dev b/bw-dev index d8c4d8596..182204c49 100755 --- a/bw-dev +++ b/bw-dev @@ -1,9 +1,18 @@ #!/bin/bash -# import our ENV variables -source .env - +# exit on errors set -e + +# import our ENV variables +# catch exits and give a friendly error message +function showerr { + echo "Failed to load configuration! You may need to update your .env and quote values with special characters in them." +} +trap showerr EXIT +source .env +trap - EXIT + +# show commands as they're executed set -x function clean {