diff --git a/bin/cget.sh b/bin/cget.sh index 414021c..13e0942 100755 --- a/bin/cget.sh +++ b/bin/cget.sh @@ -150,7 +150,6 @@ if [ -z "$CACHE_DIR" ]; then exit 2 fi if [ ! -d "$CACHE_DIR" ]; then - # think carefully about this... /bin/mkdir "$CACHE_DIR" exit_code=$? if [ $exit_code -ne 0 ]; then @@ -203,6 +202,7 @@ else TMP_DIR="${tmp_dir%%/}/${script_name%%.*}" $verbose_mode && printf "$script_name creating temp dir: %s\n" "$TMP_DIR" fi +# create a subdirectory if [ ! -d "$TMP_DIR" ]; then /bin/mkdir "$TMP_DIR" exit_code=$? @@ -234,5 +234,12 @@ if [ $exit_code -ne 0 ]; then fi $verbose_mode && printf "$script_name successfully obtained resource: %s\n" "$tmp_file" +# output the resource /bin/cat "$tmp_file" +exit_code=$? +if [ $exit_code -ne 0 ]; then + echo "ERROR: ${script_name} unable to cat output with status code: $exit_code" >&2 + exit 3 +fi + exit 0