Skip to content

Commit

Permalink
Allow setting of bash completion path (todotxt#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
karbassi authored and wwalker committed Sep 19, 2021
1 parent 15ae868 commit 98862a2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif
ifdef BASH_COMPLETION
datarootdir = $(BASH_COMPLETION)
else
datarootdir = $(prefix)/share
datarootdir = $(prefix)/share/bash_completion.d
endif

# Dynamically detect/generate version file as necessary
Expand Down Expand Up @@ -64,22 +64,22 @@ clean: test-pre-clean

install: installdirs
$(INSTALL_PROGRAM) todo.sh $(DESTDIR)$(bindir)/todo.sh
$(INSTALL_DATA) todo_completion $(DESTDIR)$(datarootdir)/bash_completion.d/todo
$(INSTALL_DATA) todo_completion $(DESTDIR)$(datarootdir)/todo
[ -e $(DESTDIR)$(sysconfdir)/todo/config ] || \
sed "s/^\(export[ \t]*TODO_DIR=\).*/\1~\/.todo/" todo.cfg > $(DESTDIR)$(sysconfdir)/todo/config

uninstall:
rm -f $(DESTDIR)$(bindir)/todo.sh
rm -f $(DESTDIR)$(datarootdir)/bash_completion.d/todo
rm -f $(DESTDIR)$(datarootdir)/todo
rm -f $(DESTDIR)$(sysconfdir)/todo/config

rmdir $(DESTDIR)$(datarootdir)/bash_completion.d
rmdir $(DESTDIR)$(datarootdir)
rmdir $(DESTDIR)$(sysconfdir)/todo

installdirs:
mkdir -p $(DESTDIR)$(bindir) \
$(DESTDIR)$(sysconfdir)/todo \
$(DESTDIR)$(datarootdir)/bash_completion.d
$(DESTDIR)$(datarootdir)

#
# Testing
Expand All @@ -100,4 +100,5 @@ test: aggregate-results
rm -rf tests/test-results

# Force tests to get run every time
.PHONY: test test-pre-clean aggregate-results $(TESTS)
.PHONY: test test-pre-clean aggregate-results $(TESTS)

0 comments on commit 98862a2

Please # to comment.