add support for $XDG_CONFIG_HOME config file/actions location
This commit is contained in:
18
todo.sh
18
todo.sh
@@ -656,6 +656,15 @@ export SENTENCE_DELIMITERS=',.:;'
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -e "$TODOTXT_CFG_FILE" ] || {
|
||||||
|
CFG_FILE_ALT="${XDG_CONFIG_HOME:-$HOME/.config}/todo/config"
|
||||||
|
|
||||||
|
if [ -e "$CFG_FILE_ALT" ]
|
||||||
|
then
|
||||||
|
TODOTXT_CFG_FILE="$CFG_FILE_ALT"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
[ -e "$TODOTXT_CFG_FILE" ] || {
|
[ -e "$TODOTXT_CFG_FILE" ] || {
|
||||||
CFG_FILE_ALT=$(dirname "$0")"/todo.cfg"
|
CFG_FILE_ALT=$(dirname "$0")"/todo.cfg"
|
||||||
|
|
||||||
@@ -690,6 +699,15 @@ fi
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ -d "$TODO_ACTIONS_DIR" ] || {
|
||||||
|
TODO_ACTIONS_DIR_ALT="${XDG_CONFIG_HOME:-$HOME/.config}/todo/actions"
|
||||||
|
|
||||||
|
if [ -d "$TODO_ACTIONS_DIR_ALT" ]
|
||||||
|
then
|
||||||
|
TODO_ACTIONS_DIR="$TODO_ACTIONS_DIR_ALT"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# === SANITY CHECKS (thanks Karl!) ===
|
# === SANITY CHECKS (thanks Karl!) ===
|
||||||
[ -r "$TODOTXT_CFG_FILE" ] || dieWithHelp "$1" "Fatal Error: Cannot read configuration file $TODOTXT_CFG_FILE"
|
[ -r "$TODOTXT_CFG_FILE" ] || dieWithHelp "$1" "Fatal Error: Cannot read configuration file $TODOTXT_CFG_FILE"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user