1
1
PREFIX ?= /usr/local
2
- BASH_COMPLETION_DIR := $(shell pkg-config --silence-errors --variable=completionsdir bash-completion)
3
- # pkg-config adds a space for some reason, we have to strip it off.
4
- BASH_COMPLETION_DIR := $(strip $(BASH_COMPLETION_DIR ) )
2
+ BASH_COMPLETION_DIR := $(shell pkg-config --silence-errors --variable=completionsdir bash-completion)
5
3
USERDIR ?= $(HOME )
6
4
7
5
# The @ symbols make the output silent.
@@ -16,21 +14,27 @@ If you have bash completion installed, follow the README \
16
14
(https ://github.com/pimterry/notes# installing-bash-completion) \
17
15
to manually install it.\n\n"; \
18
16
fi # Small test for bash completion support
17
+
19
18
@install -m755 -d $(PREFIX)/bin/
20
19
@install -m755 notes $(PREFIX)/bin/
21
- @install -m777 -d $(USERDIR ) /.config/notes/
22
- @install -m777 config $(USERDIR ) /.config/notes/
23
20
@install -d $(PREFIX)/share/man/man1/
24
21
@install notes.1 $(PREFIX)/share/man/man1/
25
22
26
23
@mandb 1>/dev/null 2>&1 || true # Fail silently if we don't have a mandb
27
24
25
+ @printf "Notes has been installed to $(PREFIX)/bin/notes.\n"
26
+
27
+ @if [ ! -f $(USERDIR)/.config/notes/config ]; then \
28
+ install -m777 -d $(USERDIR)/.config/notes/; \
29
+ install -m777 config $(USERDIR)/.config/notes/; \
30
+ printf \
31
+ "A configuration file has also been created at $(USERDIR)/.config/notes/config, \
32
+ which you can edit if you'd like to change the default settings.\n"; \
33
+ fi # install default config file if non present
34
+
28
35
@printf \
29
- "Notes has been installed to $(PREFIX)/bin/notes. \
30
- A configuration file has also been created at $(USERDIR)/.config/notes/config, \
31
- which you can edit if you'd like to change the default settings.\n\n\
32
- Get started now by running 'notes new my-note' \
33
- or you can run 'notes help' for more info.\n"
36
+ "\nGet started now by running 'notes new my-note' \
37
+ or you can run 'notes help' for more info.\n"; \
34
38
35
39
uninstall :
36
40
rm -f $(PREFIX ) /bin/notes
0 commit comments