From 7bec0d47ee2b4a0438e83c15dd152e531e334a46 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Wed, 23 May 2012 16:24:02 +0200 Subject: scripts/calcurse-upgrade: Add a "--config" option This allows for specifying an alternate configuration file which is useful if you use a non-default data directory. Signed-off-by: Lukas Fleischer --- scripts/calcurse-upgrade | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/calcurse-upgrade b/scripts/calcurse-upgrade index 1fc481f..e04b2f9 100644 --- a/scripts/calcurse-upgrade +++ b/scripts/calcurse-upgrade @@ -2,7 +2,16 @@ set -e -CONFFILE=$HOME/.calcurse/conf +if [ "$1" = "--config" ]; then + CONFFILE=$2 +else + CONFFILE=$HOME/.calcurse/conf +fi + +if [ ! -e "$CONFFILE" ]; then + echo "Configuration file not found: $CONFFILE" >&2 + exit 1 +fi if grep -q -e '^auto_save=' -e '^auto_gc=' -e '^periodic_save=' \ -e '^confirm_quit=' -e '^confirm_delete=' -e '^skip_system_dialogs=' \ -- cgit v1.2.3-70-g09d2