Skip to content

Commit e98fb4c

Browse files
committed
don't overwrite config file during installation
1 parent 3583ec8 commit e98fb4c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,27 @@ If you have bash completion installed, follow the README \
1414
(https://github.com/pimterry/notes#installing-bash-completion) \
1515
to manually install it.\n\n"; \
1616
fi # Small test for bash completion support
17+
1718
@install -m755 -d $(PREFIX)/bin/
1819
@install -m755 notes $(PREFIX)/bin/
19-
@install -m777 -d $(USERDIR)/.config/notes/
20-
@install -m777 config $(USERDIR)/.config/notes/
2120
@install -d $(PREFIX)/share/man/man1/
2221
@install notes.1 $(PREFIX)/share/man/man1/
2322

2423
@mandb 1>/dev/null 2>&1 || true # Fail silently if we don't have a mandb
2524

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+
2635
@printf \
27-
"Notes has been installed to $(PREFIX)/bin/notes. \
28-
A configuration file has also been created at $(USERDIR)/.config/notes/config, \
29-
which you can edit if you'd like to change the default settings.\n\n\
30-
Get started now by running 'notes new my-note' \
31-
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"; \
3238

3339
uninstall:
3440
rm -f $(PREFIX)/bin/notes

0 commit comments

Comments
 (0)