From 0ecfe53b2d271133fac36de11ecfc0f7e47840f0 Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Sat, 6 Jun 2026 12:27:03 -0400 Subject: Initial version complete I dusted this off after years and had Claude finish it for me. caveat emptor: this is largely (though not entirely) LLM generated as of this commit --- Makefile | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9262db1..cfd057a 100644 --- a/Makefile +++ b/Makefile @@ -12,25 +12,49 @@ endif BIN_DIR=$(HOME)/.local/bin -# TODO: ves needs to be installed as a function in the user's -# shell. This will require making updates to their configuration -# file as part of the install process, which will require a bit -# of extra work. +all: + @echo "Nothing to build. Run 'make install' to install, 'make test' to run tests." + install: - - test -d $(DATA_DIR)/ves/bin || mkdir -p $(DATA_DIR)/ves/bin - - test -d $(DATA_DIR)/ves/lib || mkdir -p $(DATA_DIR)/ves/lib - - test -d $(DATA_DIR)/ves/envs || mkdir -p $(DATA_DIR)/ves/envs - - test -d $(CONF_DIR)/ves || mkdir -p $(CONF_DIR)/ves - - test -d $(BIN_DIR)/ves_scripts || mkdir -p $(BIN_DIR)/ves_scripts + -mkdir -p $(DATA_DIR)/ves/bin + -mkdir -p $(DATA_DIR)/ves/lib + -mkdir -p $(DATA_DIR)/ves/envs + -mkdir -p $(CONF_DIR)/ves + -mkdir -p $(BIN_DIR)/ves_scripts + -mkdir -p $(DATA_DIR)/man/man1 cp ./*.sh $(BIN_DIR)/ves_scripts chmod u+x $(BIN_DIR)/ves_scripts/* + cp ./man/ves.1 $(DATA_DIR)/man/man1/ves.1 + @if command -v fish > /dev/null 2>&1; then \ + mkdir -p $(CONF_DIR)/fish/functions $(CONF_DIR)/fish/completions; \ + cp ./ves.fish $(CONF_DIR)/fish/functions/ves.fish; \ + cp ./completions/ves.fish $(CONF_DIR)/fish/completions/ves.fish; \ + echo "fish detected: installed function and completions"; \ + fi + @echo "" + @echo "Installation complete. To enable sh-ves, add the following line" + @echo "to your shell's rc or profile file:" + @echo "" + @echo " . $(BIN_DIR)/ves_scripts/ves-init.sh" + @echo "" +test: + sh ./tests/run_tests.sh + @if command -v fish > /dev/null 2>&1; then \ + fish ./tests/run_tests.fish; \ + else \ + echo "fish not found, skipping fish shim tests"; \ + fi uninstall: - - test -f $(BIN_DIR)/ves && rm -f $(BIN_DIR)/ves - - test -d $(BIN_DIR)/ves_scripts && rm -rf $(BIN_DIR)/ves_scripts - + -rm -f $(BIN_DIR)/ves + -rm -rf $(BIN_DIR)/ves_scripts + -rm -f $(CONF_DIR)/fish/functions/ves.fish + -rm -f $(CONF_DIR)/fish/completions/ves.fish + -rm -f $(DATA_DIR)/man/man1/ves.1 purge: uninstall - - test -d $(DATA_DIR)/ves && rm -rf $(DATA_DIR)/ves - - test -d $(CONF_DIR)/ves && rm -rf $(CONF_DIR)/ves + -rm -rf $(DATA_DIR)/ves + -rm -rf $(CONF_DIR)/ves + +.PHONY: all install test uninstall purge -- cgit v1.2.3