diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-01-05 16:45:12 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-01-05 16:45:12 -0800 |
| commit | 0c1b3d429a03897f3551912cf93a317bcb1c603a (patch) | |
| tree | 1e1d1361a7e5e10fb71661c181de59e69a01240f /Makefile | |
| parent | 4891206c071679f82d72ad9e81fca88527013051 (diff) | |
Improved install/uninstall process and updated doc.
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -9,9 +9,14 @@ install: read -p $$'\033[1mWhere do you want to install? (default: /usr/local) \033[0m' prefix; \ fi; \ if [[ ! $$prefix ]]; then prefix="/usr/local"; fi; \ + echo $$'\033[1mInstalling...\033[0m'; \ mkdir -pv $$prefix/bin $$prefix/share/man/man1 \ && cp -v nowopen $$prefix/bin/ \ - && cp -v doc/nowopen.1 $$prefix/share/man/man1/; + && cp -v doc/nowopen.1 $$prefix/share/man/man1/; \ + xdg_data_home=$$XDG_DATA_HOME; \ + if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \ + echo $$'\033[1mInstallation complete.\033[0m'; \ + echo "Put your business hours file in either $$xdg_data_home/nowopen/businesshours or ~/.businesshours"; uninstall: @prefix="$(PREFIX)"; \ @@ -19,14 +24,10 @@ uninstall: read -p $$'\033[1mWhere do you want to uninstall from? (default: /usr/local) \033[0m' prefix; \ fi; \ if [[ ! $$prefix ]]; then prefix="/usr/local"; fi; \ - echo "Deleting..."; \ + echo $$'\033[1mDeleting...\033[0m'; \ + rm -rvf $$prefix/bin/nowopen $$prefix/share/man/man1/doc/nowopen.1; \ xdg_data_home=$$XDG_DATA_HOME; \ - if [[ ! $$xdg_data_home ]]; then $$xdg_data_home = "~/.local/share"; fi; \ - for f in $$xdg_data_home/nowopen ~/.businesshours; do \ - if [[ -f $$f || -d $$f ]]; then \ - read -p "Do you want to delete $$f? (Y/n) " confirm; \ - if [[ confirm -ne "n" ]]; then rm -rvf $$f; fi; \ - fi; \ - done; \ - rm -rvf $$prefix/bin/nowopen $$prefix/share/man/man1/doc/nowopen.1; + if [[ ! $$xdg_data_home ]]; then xdg_data_home="~/.local/share"; fi; \ + echo $$'\033[1mUninstallation complete.\033[0m'; \ + echo "You may want to delete your data from $$xdg_data_home/nowopen/businesshours or ~/.businesshours"; |
