<commit_before>PREFIX ?= /usr/local
BASH_COMPLETION_DIR := $(shell pkg-config --silence-errors --variable=completionsdir bash-completion) 
# pkg-config adds a space for some reason, we have to strip it off.
BASH_COMPLETION_DIR := $(strip $(BASH_COMPLETION_DIR))
USERDIR ?= $(HOME)

# The @ symbols make the output silent.

install:
	@if [ $(BASH_COMPLETION_DIR) ]; then \
		cp notes.bash_completion "$(BASH_COMPLETION_DIR)/notes"; \
	else \
		echo "Bash Completion was not installed, because the directory was" \
		"not found. if you have bash completion installed, follow the" \
		"README (https://github.com/pimterry/notes#installing-bash-completion)" \
		"to manually install it."; \
	fi # Small test for bash completion support
	@install -m755 -d $(PREFIX)/bin/
	@install -m755 notes $(PREFIX)/bin/
	@install -m777 -d $(USERDIR)/.config/notes/
	@install -m777 config $(USERDIR)/.config/notes/
	@install -d $(PREFIX)/share/man/man1/
	@install notes.1 $(PREFIX)/share/man/man1/
	@mandb 1>/dev/null 2>&1 # Fail silently if we don't have a mandb
	@echo -e "Notes has been installed to $(PREFIX)/bin/notes." \
	"A configuration file has also been created at" \
	"$(USERDIR)/.config/notes/config," \
	"which you can edit if you'd like to change the default settings." \
	"\nGet started now by running notes open my-new-note" \
	"Or you can run notes help for more info"
	
uninstall:
	rm -f $(PREFIX)/bin/notes
	rm -f $(PREFIX)/share/man/man1/notes.1
	rm -f $(BASH_COMPLETION_DIR)/notes
	rm -f $(USERDIR)/.config/notes/config.example<commit_msg>Fix installation output on OSX (with printf) & tweak message formatting.<commit_after>PREFIX ?= /usr/local
BASH_COMPLETION_DIR := $(shell pkg-config --silence-errors --variable=completionsdir bash-completion) 
# pkg-config adds a space for some reason, we have to strip it off.
BASH_COMPLETION_DIR := $(strip $(BASH_COMPLETION_DIR))
USERDIR ?= $(HOME)

# The @ symbols make the output silent.

install:
	@if [ $(BASH_COMPLETION_DIR) ]; then \
		cp notes.bash_completion "$(BASH_COMPLETION_DIR)/notes"; \
	else \
		printf \
"Bash completion was not installed, because the directory was not found. \
If you have bash completion installed, follow the README \
(https://github.com/pimterry/notes#installing-bash-completion) \
to manually install it.\n\n"; \
	fi # Small test for bash completion support
	@install -m755 -d $(PREFIX)/bin/
	@install -m755 notes $(PREFIX)/bin/
	@install -m777 -d $(USERDIR)/.config/notes/
	@install -m777 config $(USERDIR)/.config/notes/
	@install -d $(PREFIX)/share/man/man1/
	@install notes.1 $(PREFIX)/share/man/man1/
	@mandb 1>/dev/null 2>&1 # Fail silently if we don't have a mandb

	@printf \
"Notes has been installed to $(PREFIX)/bin/notes. \
A configuration file has also been created at $(USERDIR)/.config/notes/config, \
which you can edit if you'd like to change the default settings.\n\n\
Get started now by running 'notes new my-note' \
or you can run 'notes help' for more info.\n"

uninstall:
	rm -f $(PREFIX)/bin/notes
	rm -f $(PREFIX)/share/man/man1/notes.1
	rm -f $(BASH_COMPLETION_DIR)/notes
	rm -f $(USERDIR)/.config/notes/config.example

	@printf "\nNotes has now been uninstalled.\n"
{'fraction_non_alphanumeric': 0.13673597983616886, 'fraction_numerical': 0.01260239445494644, 'mean_word_length': 3.9072642967542506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4271409', 'n_tokens_mistral': 1116, 'n_tokens_neox': 1065, 'n_words': 343}