code / nowopen

Lines270 Lua215 make29 Markdown26
(33 lines)
1 PREFIX=
3 all:
4 @echo "Nothing to build."
6 install:
7 @prefix="$(PREFIX)"; \
8 if [[ ! $$prefix ]]; then \
9 read -p $$'\033[1mWhere do you want to install? (default: /usr/local) \033[0m' prefix; \
10 fi; \
11 if [[ ! $$prefix ]]; then prefix="/usr/local"; fi; \
12 echo $$'\033[1mInstalling...\033[0m'; \
13 mkdir -pv $$prefix/bin $$prefix/share/man/man1 \
14 && cp -v nowopen $$prefix/bin/ \
15 && cp -v doc/nowopen.1 $$prefix/share/man/man1/; \
16 xdg_data_home=$$XDG_DATA_HOME; \
17 if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \
18 echo $$'\033[1mInstallation complete.\033[0m'; \
19 echo "Put your business hours file in either $$xdg_data_home/nowopen/businesshours or ~/.businesshours";
21 uninstall:
22 @prefix="$(PREFIX)"; \
23 if [[ ! $$prefix ]]; then \
24 read -p $$'\033[1mWhere do you want to uninstall from? (default: /usr/local) \033[0m' prefix; \
25 fi; \
26 if [[ ! $$prefix ]]; then prefix="/usr/local"; fi; \
27 echo $$'\033[1mDeleting...\033[0m'; \
28 rm -rvf $$prefix/bin/nowopen $$prefix/share/man/man1/nowopen.1; \
29 xdg_data_home=$$XDG_DATA_HOME; \
30 if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \
31 echo $$'\033[1mUninstallation complete.\033[0m'; \
32 echo "You may want to delete your data from $$xdg_data_home/nowopen/businesshours or ~/.businesshours";