Allow the use of global config file

If not found elsewhere, look for the config file in /etc/todo/config.
`make install` installs a global config file, setting TODO_DIR=~/.todo.
todo.sh creates TODO_DIR if it doesn't exist.
This commit is contained in:
Manuel J. Garrido
2013-06-24 10:32:42 +02:00
parent 93d8e16d50
commit ce365df67c
4 changed files with 29 additions and 4 deletions

View File

@@ -33,9 +33,9 @@ clean:
install:
install --mode=755 todo.sh $(INSTALL_DIR)
install --mode=644 todo_completion /etc/bash_completion.d/todo
mkdir -p ~/.todo
cp -n todo.cfg ~/.todo/config
mkdir -p /etc/todo
[ -e /etc/todo/config ] || \
sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > /etc/todo/config
#
# Testing
#