From 2067946044c960ab4cd64b3b7ca7b362f02728d6 Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Mon, 10 Feb 2014 08:53:35 -0500 Subject: [PATCH] If the export fails, abort this script, to avoid checking in an empty directory that may have been left behind by the failed export. --- calendar-run.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/calendar-run.sh b/calendar-run.sh index 002f201..8091c90 100755 --- a/calendar-run.sh +++ b/calendar-run.sh @@ -1,4 +1,4 @@ -#!/bin/bash +!/bin/bash # Copyright (C) 2013 Bradley M. Kuhn # # The copyright holders wish that this script could be placed into the public @@ -23,8 +23,11 @@ set -e HOME_MACHINE=baptist.ebb.org ~/hacks/Small-Hacks/calendar-export.plx ~/Public-Configuration/calendar-export-home.config - -cd ~/calendars +if [ $? -ne 0 ]; then + echo '${color5} Failure in $0: Aborting after export' + remove_lock + exit 1 +fi cd ~/calendars/personal/private/bkuhn