From a275c9670131e4233a7534d645e0eefaed4d7c3f Mon Sep 17 00:00:00 2001
From: Tom Scavo <trscavo@internet2.edu>
Date: Sun, 7 May 2017 13:51:22 -0400
Subject: [PATCH] Check the output directory

---
 bin/process_export_aggregate.sh | 4 ++++
 bin/process_main_aggregate.sh   | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/bin/process_export_aggregate.sh b/bin/process_export_aggregate.sh
index f9a7e78..c822030 100755
--- a/bin/process_export_aggregate.sh
+++ b/bin/process_export_aggregate.sh
@@ -145,6 +145,10 @@ if $help_mode; then
 fi
 
 # check the output directory
+if [ -z "$out_dir" ]; then
+	echo "ERROR: $script_name: no output directory specified" >&2
+	exit 2
+fi
 if [ ! -d "$out_dir" ]; then
 	echo "ERROR: $script_name: directory does not exist: $out_dir" >&2
 	exit 2
diff --git a/bin/process_main_aggregate.sh b/bin/process_main_aggregate.sh
index 36cb343..b38831b 100755
--- a/bin/process_main_aggregate.sh
+++ b/bin/process_main_aggregate.sh
@@ -161,6 +161,10 @@ if $help_mode; then
 fi
 
 # check the output directory
+if [ -z "$out_dir" ]; then
+	echo "ERROR: $script_name: no output directory specified" >&2
+	exit 2
+fi
 if [ ! -d "$out_dir" ]; then
 	echo "ERROR: $script_name: directory does not exist: $out_dir" >&2
 	exit 2